Skip to content

Commit

Permalink
another spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Chu committed Jul 6, 2019
1 parent 3cd91fb commit ce31115
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion spec/command_.test.sh
Expand Up @@ -102,7 +102,7 @@ one
cd $TMP
PATH="one:two:$PATH"
mkdir -p one two
rm -f one/mycmd two/cmd
rm -f one/mycmd two/mycmd

echo 'echo two' > two/mycmd
chmod +x two/mycmd
Expand All @@ -129,3 +129,24 @@ status=0
one
status=0
## END

#### Non-executable on $PATH

# shells differ in whether they actually execve('one/cmd') and get EPERM

cd $TMP
PATH="one:two:$PATH"
mkdir -p one two
rm -f one/mycmd two/mycmd

echo 'echo one' > one/mycmd
echo 'echo two' > two/mycmd

# only make the second one executable
chmod +x two/mycmd
mycmd
echo status=$?
## STDOUT:
two
status=0
## END

0 comments on commit ce31115

Please sign in to comment.