tony_taoyh
Full Member level 2
replace with arabic text using sed unix shell
Hi, Now I have one file as following:
-- abcd efgh
-- mm gg
-- ddd
123456
abcdefgh
-- here there is some whitespace...
gggg
fffffff
(File end here)
**************************
I use the following UNIX C shell to exclude those line starting with '--'.
#!/bin/csh
foreach line (`cat file.txt`)
if ($line =~ "--")
echo $line
endif
end
The script always fail to work...
Can you help me??
Because for the "foreach" in CSHELL,
the list element is split using whitespace instead of "change line",
SO there is some strings like "abcd", "efgh" will be assigned to $line.
Any method to solve this problem?
Thanks a lot.
Hi, Now I have one file as following:
-- abcd efgh
-- mm gg
-- ddd
123456
abcdefgh
-- here there is some whitespace...
gggg
fffffff
(File end here)
**************************
I use the following UNIX C shell to exclude those line starting with '--'.
#!/bin/csh
foreach line (`cat file.txt`)
if ($line =~ "--")
echo $line
endif
end
The script always fail to work...
Can you help me??
Because for the "foreach" in CSHELL,
the list element is split using whitespace instead of "change line",
SO there is some strings like "abcd", "efgh" will be assigned to $line.
Any method to solve this problem?
Thanks a lot.