[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Unable to do a for loop in "here document"
From: |
Mr Aras |
Subject: |
Unable to do a for loop in "here document" |
Date: |
Tue, 8 Jul 2008 20:44:47 -0700 (PDT) |
Hi,
I've been trying to do a "for loop" in a "here document" but the variable is
never assigned to the items in the list.
e.g.
#!/bin/sh
sh <<-EOF
for word in hello world
do
echo word = $word
done
EOF
output is:
word =
word =
Can someone tell me why this doesn't work? I've been going nuts trying to
figure this one out.
--
View this message in context:
http://www.nabble.com/Unable-to-do-a-for-loop-in-%22here-document%22-tp18353951p18353951.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.
- Unable to do a for loop in "here document",
Mr Aras <=