change ps command to be more portable
This commit is contained in:
parent
1752d19e35
commit
1f26a67c9e
@ -2,8 +2,8 @@
|
||||
|
||||
# Assuming that urchin was invoked with `-s bash`, this script should be being run with bash.
|
||||
|
||||
this_shell=$(ps -o comm= -p $$ && :)
|
||||
this_shell=$(ps -o pid,comm | sed -n "s/^ *$$//p" | cut -d\ -f2)
|
||||
|
||||
echo "Running shell: $this_shell"
|
||||
|
||||
[ "$(basename "$this_shell")" = '.special-shell' ]
|
||||
basename "$this_shell" | grep .special-shell
|
||||
|
@ -1,9 +1,10 @@
|
||||
# By design, this file has no shebang line.
|
||||
set -e
|
||||
|
||||
# Assuming that urchin was invoked with `-s bash`, this script should be being run with bash.
|
||||
|
||||
this_shell=$(ps -o comm= -p $$ && :)
|
||||
this_shell=$(ps -o pid,comm | sed -n "s/^ *$$//p" | cut -d\ -f2)
|
||||
|
||||
echo "Running shell: $this_shell"
|
||||
|
||||
[ "$(basename "$this_shell")" = '.special-shell' ]
|
||||
basename "$this_shell" | grep .special-shell
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
# Assuming that urchin was invoked with `-s bash`, $TEST_SHELL should contain 'bash'.
|
||||
|
||||
echo "Running shell: $(ps -o comm= -p $$ && :)"
|
||||
this_shell=$(ps -o pid,comm | sed -n "s/^ *$$//p" | cut -d\ -f2)
|
||||
echo "Running shell: $this_shell"
|
||||
|
||||
echo "\$TEST_SHELL: $TEST_SHELL"
|
||||
|
||||
[ "$(basename "$this_shell")" = '.special-shell' ]
|
||||
basename "$this_shell" | grep .special-shell
|
||||
|
Loading…
Reference in New Issue
Block a user