I want to create a new file name based on reading and grepping for a word in an existing file.
Example script:
#/bin/ksh
grep "*IUNB" file1.xxx.edw > r.out
cut -c 6-10 r.out > r.in
r.out = *IUNBCHERA ZZ FASJRIV Z
Z UNOA22003090911521002 '+:
r.in = CHERA
I would like the new file to be called:
"a-rivCHERA.edw" The extention of the new file needs to be the same as the source file in the inital grep command.
The "a-riv" can be hardcoded somewhere.
Example script:
#/bin/ksh
grep "*IUNB" file1.xxx.edw > r.out
cut -c 6-10 r.out > r.in
r.out = *IUNBCHERA ZZ FASJRIV Z
Z UNOA22003090911521002 '+:
r.in = CHERA
I would like the new file to be called:
"a-rivCHERA.edw" The extention of the new file needs to be the same as the source file in the inital grep command.
The "a-riv" can be hardcoded somewhere.