When the "<" operator is used in conjunction with process substitution,
the "<#" operator doesn't seem to have an effect:
========================================
$ echo ${.sh.version}
Version AIJM 93v- 2013-08-27
$ cat script3.ksh
while read -r record
do
printf '%s\n' "${record}"
<#record*
done < <(cat file.txt)
$ ./script2.ksh
record1
line1_record1
record2
line1_record2
record3
line1_record3
========================================
If the input is redirected from the file directly instead of
fifo-or-/dev/fd from process substitution, "<#" works as expected:
========================================
$ cat file.txt
record1
line1_record1
record2
line1_record2
record3
line1_record3$ cat script1.kshwhile read -r record
do
printf '%s\n' "${record}"
<#record*
done < file.txt
$ ./script1.ksh
record1
record2
record3
========================================
If the standard input of the while loop is read from a pipe, the
expected results are also observed:
========================================
$ cat script2.ksh
cat file.txt |
while read -r record
do
printf '%s\n' "${record}"
<#record*
done
$ ./script2.ksh
record1
record2
record3
========================================
--
Nathan Weeks
IT Specialist
USDA-ARS Corn Insects and Crop Genetics Research Unit
http://weeks.public.iastate.edu/
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users