Afficher un message
Vieux 25/08/2006, 11h40   #1
Rakesh Sharma
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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

  Réponse avec citation
 
Page generated in 0,04887 seconds with 9 queries