diff options
author | Peter Stephenson <p.stephenson@samsung.com> | 2018-09-05 17:58:04 +0100 |
---|---|---|
committer | Peter Stephenson <p.stephenson@samsung.com> | 2018-09-05 17:58:41 +0100 |
commit | 9bc7e5b404d7d4f45a54e4d44d7a75f1c486810b (patch) | |
tree | 154fb6b560c5c8b839b76b080bb32c91a28a327e /Test | |
parent | 55f1afcec83629a089fd96bc64b4005960eebe90 (diff) | |
download | zsh-9bc7e5b404d7d4f45a54e4d44d7a75f1c486810b.tar.gz zsh-9bc7e5b404d7d4f45a54e4d44d7a75f1c486810b.tar.xz zsh-9bc7e5b404d7d4f45a54e4d44d7a75f1c486810b.zip |
43375 with fix from 43390: fix #! tests.
Don't assume path to sh and echo, instead work it out.
Diffstat (limited to 'Test')
-rw-r--r-- | Test/A05execution.ztst | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst index fb39d0589..567bd2530 100644 --- a/Test/A05execution.ztst +++ b/Test/A05execution.ztst @@ -6,16 +6,20 @@ cd command.tmp - print '#!/bin/sh\necho This is top' >tstcmd + shcmd="$(which sh)" + shpath=${shcmd:h} + echocmd="$(which -p echo)" + echopath=${echocmd:h} + print "#!${shcmd}\necho This is top" >tstcmd - print '#!/bin/sh\necho This is dir1' >dir1/tstcmd + print "#!${shcmd}\necho This is dir1" >dir1/tstcmd - print '#!/bin/sh\necho This is dir2' >dir2/tstcmd + print "#!${shcmd}\necho This is dir2" >dir2/tstcmd print -n '#!sh\necho This is slashless' >tstcmd-slashless print -n '#!echo foo\necho This is arg' >tstcmd-arg print '#!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxnyyy' >tstcmd-interp-too-long - print '#!/bin/sh\necho should not execute; exit 1' >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxn + print "#!${sh}\necho should not execute; exit 1" >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxn chmod 755 tstcmd dir1/tstcmd dir2/tstcmd chmod 755 tstcmd-slashless tstcmd-arg tstcmd-interp-too-long @@ -40,15 +44,15 @@ 0:path (2) >This is top - PATH=/bin:${ZTST_testdir}/command.tmp/ tstcmd-slashless + PATH=${shpath}:${ZTST_testdir}/command.tmp/ tstcmd-slashless 0:path (3) >This is slashless - PATH=/bin:${ZTST_testdir}/command.tmp tstcmd-arg + PATH=${echopath}:${ZTST_testdir}/command.tmp tstcmd-arg 0:path (4) *>foo */command.tmp/tstcmd-arg - path=(/bin ${ZTST_testdir}/command.tmp/) + path=($shpath $echopath ${ZTST_testdir}/command.tmp/) tstcmd-interp-too-long 2>&1; echo "status $?" path=($storepath) 0:path (5) |