Hi.
My script is such as:
$ ./a.sh input.txt
where a.sh has:
#!/bin/sh
out=/root/probe/out.txt
cat $1 |while read LINE
do
echo $LINE >> $out
done
and input.txt has:
111 666 888 000 999 * 66
3 3 999 * 8 8
each column is separated with tabulation.
The problem is when I execute my script. The output of out.txt is:
111 666 888 000 999 a.sh input.txt 66
3 3 999 a.sh input.txt out.txt 8 8
i.e., where there is * (in the input.txt file) puts the files of the current folder (/root/probe/).
How can I make so that it lists to me the line so as it has input.txt, reading the file line to line and without be able to change input.txt file?
Thanks.
My script is such as:
$ ./a.sh input.txt
where a.sh has:
#!/bin/sh
out=/root/probe/out.txt
cat $1 |while read LINE
do
echo $LINE >> $out
done
and input.txt has:
111 666 888 000 999 * 66
3 3 999 * 8 8
each column is separated with tabulation.
The problem is when I execute my script. The output of out.txt is:
111 666 888 000 999 a.sh input.txt 66
3 3 999 a.sh input.txt out.txt 8 8
i.e., where there is * (in the input.txt file) puts the files of the current folder (/root/probe/).
How can I make so that it lists to me the line so as it has input.txt, reading the file line to line and without be able to change input.txt file?
Thanks.