I am stuck on a problem of deleting input lines from a file.
The first 9 char indicating a file name and this line should be removed and rest of lines should be send to outpile. In below you can find my first script, but unfortunately it will removing only last line in file eg "CDALLLLLS01148"
input file(list.txt):
CDALLLLLS01147
CDALLLLLS01148
CDARRRRRR01150
CDARRRRRR01151
CDARRRRRR01152
script:
#!/bin/sh
list=uus.txt
while read line
do
file="`echo $line|cut -c 1-8`"
less $file | sed -e "/^$line/!d" >$file.new
done < $list
thanks for you help
The first 9 char indicating a file name and this line should be removed and rest of lines should be send to outpile. In below you can find my first script, but unfortunately it will removing only last line in file eg "CDALLLLLS01148"
input file(list.txt):
CDALLLLLS01147
CDALLLLLS01148
CDARRRRRR01150
CDARRRRRR01151
CDARRRRRR01152
script:
#!/bin/sh
list=uus.txt
while read line
do
file="`echo $line|cut -c 1-8`"
less $file | sed -e "/^$line/!d" >$file.new
done < $list
thanks for you help