Lines Matching refs:tmp

31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
32 trap "cd /; rm -rf $tmp" EXIT
43 print 'read -r a; print -r -u$1 -- "$a"' > $tmp/mycat
44 chmod 755 $tmp/mycat
47 eval "a=\$(print foo | $tmp/mycat" $i $i'>&1 > /dev/null |cat)' 2> /dev/null
53 cd $tmp || { err_exit "cd $tmp failed"; exit ; }
176 cat > $tmp/1 <<- ++EOF++
177 script=$tmp/2
192 chmod +x $tmp/1
193 [[ $($SHELL $tmp/1) == ok ]] || err_exit "parent i/o causes child script to fail"
195 cat > $tmp/1 <<- \++EOF++
203 chmod +x $tmp/1
204 [[ $($tmp/1) == ok ]] || err_exit "trap on EXIT loses last command redirection"
205 print > /dev/null {n}> $tmp/1
206 [[ ! -s $tmp/1 ]] && newio=1
217 done > $tmp/seek
218 if command exec 3<> $tmp/seek
253 cat $tmp/seek | read -r <# *WWW*
255 { < $tmp/seek <# ((2358336120)) ;} 2> /dev/null || err_exit 'long seek not working'
256 else err_exit "$tmp/seek: cannot open for reading"
261 done > $tmp/seek
262 if command exec {n}<> $tmp/seek
282 $SHELL -c "{ > $tmp/1 ; date;} >&- 2> /dev/null" > $tmp/2
283 [[ -s $tmp/1 || -s $tmp/2 ]] && err_exit 'commands with standard output closed produce output'
296 print hello > $tmp/1
297 if ! $SHELL -c "false >; $tmp/1" 2> /dev/null
298 then let 1;[[ $(<$tmp/1) == hello ]] || err_exit '>; not preserving file on failure'
300 if ! $SHELL -c "sed -e 's/hello/hello world/' $tmp/1" >; $tmp/1 2> /dev/null
301 then [[ $(<$tmp/1) == 'hello world' ]] || err_exit '>; not updating file on success'
306 print $'hello\nworld' > $tmp/1
307 if ! $SHELL -c "false <>; $tmp/1" 2> /dev/null
308 then [[ $(<$tmp/1) == $'hello\nworld' ]] || err_exit '<>; not preserving file on failure'
310 if ! $SHELL -c "head -1 $tmp/1" <>; $tmp/1 2> /dev/null
311 then [[ $(<$tmp/1) == hello ]] || err_exit '<>; not truncating file on success of head'
313 print $'hello\nworld' > $tmp/1
314 if ! $SHELL -c head < $tmp/1 <#((6)) <>; $tmp/1 2> /dev/null
315 then [[ $(<$tmp/1) == world ]] || err_exit '<>; not truncating file on success of behead'
340 if mkfifo $tmp/fifo 2> /dev/null
341 then (print -n a; sleep 2; print -n bcde) > $tmp/fifo &
345 } 5< $tmp/fifo
352 rm -f $tmp/fifo
354 mkfifo $tmp/fifo 2> /dev/null
355 (print -n a; sleep 2; print -n bcde) > $tmp/fifo &
359 } 5< $tmp/fifo
435 file=$tmp/file
448 exec 1> $tmp/21.out 2> $tmp/22.out
452 print :1:Z:" 1> $tmp/11.out 2> $tmp/12.out
453 [[ -s $tmp/11.out ]] && err_exit "standard output leaked past redirection"
454 [[ -s $tmp/12.out ]] && err_exit "standard error leaked past redirection"
456 got=$(<$tmp/21.out)
459 got=$(<$tmp/22.out)
462 tmp=$tmp $SHELL 2> /dev/null -c 'exec 3<&1 ; exec 1<&- ; exec > $tmp/outfile;print foobar' || err_e…
463 [[ $(<$tmp/outfile) == foobar ]] || err_exit 'outfile does not contain foobar'
465 print hello there world > $tmp/foobar
466 sed -e 's/there //' $tmp/foobar >; $tmp/foobar
467 [[ $(<$tmp/foobar) == 'hello world' ]] || err_exit '>; redirection not working on simple command'
468 print hello there world > $tmp/foobar
469 { sed -e 's/there //' $tmp/foobar;print done;} >; $tmp/foobar
470 [[ $(<$tmp/foobar) == $'hello world\ndone' ]] || err_exit '>; redirection not working for compound …
471 print hello there world > $tmp/foobar
472 $SHELL -c "sed -e 's/there //' $tmp/foobar >; $tmp/foobar"
473 [[ $(<$tmp/foobar) == 'hello world' ]] || err_exit '>; redirection not working with -c on a simple …
475 rm -f "$tmp/junk"
477 do out=$(/bin/ls "$tmp/junk" 2>/dev/null)
484 rm -f $tmp/file1 $tmp/file2
485 print foo > $tmp/file3
486 ln -s $tmp/file3 $tmp/file2
487 ln -s $tmp/file2 $tmp/file1
488 print bar >; $tmp/file1
489 [[ $(<$tmp/file3) == bar ]] || err_exit '>; not following symlinks'