goldenradium2001
Technical User
For the for loop in the Korn shell, I know that it's possible to read from a file and use the contents of the file as input to the for loop. FOr example, the following is possible in the Korn shell:
for variable in $(< file)
do
echo $variable
done
Within file is the following:
apple
orange
pear
peach
So the output from running the for loop in Korn would be:
apple
orange
pear
peach
However, is there a way to do this on the Bourne shell or is this strictly Korn shell.
Thanks.
for variable in $(< file)
do
echo $variable
done
Within file is the following:
apple
orange
pear
peach
So the output from running the for loop in Korn would be:
apple
orange
pear
peach
However, is there a way to do this on the Bourne shell or is this strictly Korn shell.
Thanks.