Hi,
If I'm understanding this correctly, executing the command
from the command line spawns a new k-shell, and runs the command "command" in that shell. This seems to work fine, unless my "command" statement involves variables... for example:
the output is a lot of blank lines, while running the same command w/o the "ksh -c" yields non-blank output. My knowledge is a little hazy when it comes to subshells... Can anybody provide a technical explanation as to why this is happening, and how - using "ksh -c" - I can get variables such as my $REPLY to show output?
Thanks!
dora
If I'm understanding this correctly, executing the command
Code:
ksh -c "command";
from the command line spawns a new k-shell, and runs the command "command" in that shell. This seems to work fine, unless my "command" statement involves variables... for example:
Code:
ksh -c "ls | while read -r
do
echo $REPLY;
done;"
the output is a lot of blank lines, while running the same command w/o the "ksh -c" yields non-blank output. My knowledge is a little hazy when it comes to subshells... Can anybody provide a technical explanation as to why this is happening, and how - using "ksh -c" - I can get variables such as my $REPLY to show output?
Thanks!
dora