Hi pls help me out to short out this problem
rm PAB113_011.out
rm: PAB113_011.out: override protection 644 (yes/no)? n
If i give y it remove the file.
But i added the rm command as a part of ksh file and i tried to remove the file. Its not removing and the the file prompting as below
joly!edwopr(Dv03) /apps/edw/Direct_DW/Dv03/output
==> ksh test.ksh
hi
rm: /apps/edw/Direct_DW/Dv03/output/ is a directory
rm: PAB113_011.out: override protection 644 (yes/no)?
is there anyway to give 'yes' in the script level itself.
Hi,
in bash, you'll adapt if needed to KSH:
while IFS='|' read -r -a array; do printf '%s\n' "${array[@]}"; done < yourSample
aaaaa
erereer<5spaces>ooo
tteererer<4spaces>ooooo
rrererere<6SPACES>oo<6SPACES>oo<6SPACES>oo<6SPACES>oo<6SPACES>oo
eeee
tr '|' $'\n' < yourSample
same output
tr '|' '\n' < infile > outfile
echo $line | tr '|' '\n' >> $2
Hi I am already using this in my code. My problem is get the same spaces as in the input file.
please replace the <6spaces> with spaces when trying the code and let me know the solution ,..
Waiting for ur response
your problem is that you don't quote $line.
Use More Quotes!
Maybe this would also work for you:
(or use grep -Eo ... instead of egrep)
The grep basically says just print the matched pattern, which is anything but a pipe symbol ("[^|]", repeated more than one time, "+".
sri_aue:
echo $line | tr '|' '\n' >> $2
Hi I am already using this in my code. My problem is get the same spaces as in the input file.
please replace the <6spaces> with spaces when trying the code and let me know the solution ,..
Waiting for ur response
Don't use a loop, this is sufficient:
#!/bin/ksh
tr '|' '\n' < $1 > $2