awk - Getting substring using ksh script -
i'm using ksh
script determine delimiter in file using awk
. know delimiter in 4 position on first line. issue i'm having character being used in delimiter in particular file *
, instead of returning *
in variable script returning file list. here sample text in file along script:
text in file:
xxx*xx* *xx*xxxxxxx.......
here kind of script looks (i don't have script in front of me jist):
delimiter=$(awk '{substr $0, 4, 1}' file.txt) echo ${delimiter} # lists files in directory..file.txt file1.txt file2.txt instead of * desired result
thank in advance,
anthony
the shell interpreting content of delimiter
variable. need quote avoid behaviour:
echo "${delimiter}"
it print *
Comments
Post a Comment