Coder Social home page Coder Social logo

shell-toolbox's People

Contributors

kusalananda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

shell-toolbox's Issues

Centos 7 several shells with the same name

I've just tested 'develop' branch and find an interesting issue. Without parameters shell returns these shells:

Valid shells:
	/bin/sh
	/bin/bash
	/sbin/nologin
	/usr/bin/sh
	/usr/bin/bash
	/usr/sbin/nologin

Of cause regular expression ("/$shell$") in line 116 doesn't works in this case (I've added echoing for testing):

[yurij@centos7 bin]$ ./shell bash
Realshell: /bin/bash /usr/bin/bash
shell: No such shell: bash
Valid shells:
	/bin/sh
	/bin/bash
	/sbin/nologin
	/usr/bin/sh
	/usr/bin/bash
	/usr/sbin/nologin
[yurij@centos7 bin]$ ./shell /bin/bash
Realshell: /bin/bash /usr/bin/bash
shell: No such shell: bash
Valid shells:
	/bin/sh
	/bin/bash
	/sbin/nologin
	/usr/bin/sh
	/usr/bin/bash
	/usr/sbin/nologin

There are at least two approaches possible in this case:

  1. Fix regular expression;
  2. In get_shells function (line 80) add one condition which checks that file is not symbolic link, because:
[yurij@centos7 bin]$ readlink -f /usr/bin/bash
/usr/bin/bash
[yurij@centos7 bin]$ readlink -f /bin/bash
/usr/bin/bash 

Can I contribute?
Interesting project. Thanks for this!

Comparison null string to zero (int)

I've just pulled devel branch, also reconfigure & make. Start it:

[yurij@centos7 src]$ ./shell
./shell: line 142: [: : integer expression expected
Starting /bin/bash in /tmp/shell-bash.BuwfbqXK
$ exit
exit
Removing /tmp/shell-bash.BuwfbqXK

Assume that keep variable need to set to zero before handle cmdline options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.