考虑如下:<><>mple 文字:
#!/bin/sh
do_something() {
echo $@
return 1
}
cat <<EOF > sample.text
This is a sample text
It serves no other purpose
EOF
cat sample.text | while read arg1 arg2 arg3 arg4 arg5; do
ret=0
do_something "$arg1" "$sarg2" "$arg3" "$arg4" "$arg5" <&3 || ret=$?
done 3<&1
What is the purpose of redirecting stdout
as input for filedescriptor 3?
At least in Bash
, it does not seem to make any difference if omitted. Does it have any effect if it is executed in any other shell than bash
?
UPDATE
对于在什么地方这样做的人们来说,这是一种从Debian s > 加密碎克_start/code>。 说明。