How to make a bourne shell user-defined function take input from heredoc
hi,
how do we make a user-defined function in bourne shells to be able to
take it's input(s) from either it's argument list or a heredoc?
For example,
func1() {
printf '%s\n' "$@"
return 0
}
func1 "$var1" 'arg2' # works fine when arguments provided
# by means of shell variables or hardcoded strings
# but this doesnt work
func1 << EOF
this is some heredoc
usage: FOOBAR tmpdir tmpfile codename
EOF
Regards,
Rakesh
|