Created
August 19, 2014 16:27
-
-
Save Fity/0ecb4117eb62198b1040 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# with bugs, can not use $$, it is the current pid, use $PPID instead | |
function Usage() { | |
cat<<EOF | |
change the parameter orders of the last command and execute again | |
eg: | |
for commmand 'ls -l -a -h' | |
chargs 3 1 2 | |
will execute 'ls -h -l -a' | |
EOF | |
} | |
function Main() { | |
local c_shell | |
c_shell=$(get_shell) | |
echo "current shell is *$c_shell*" | |
} | |
function get_shell { | |
ps -ef | grep $$ | grep -v grep | grep -v ps | awk '{print $8}' | grep -v awk | |
} | |
Main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment