The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



Thread: Text Editing
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #8 (permalink)  
Old 10-19-2006
Glenn Arndt's Avatar
Glenn Arndt Glenn Arndt is offline
Anomalous Lurker
 

Join Date: Feb 2006
Location: Indianapolis, IN
Posts: 255
Quote:
Originally Posted by napolayan
Code:
#!/bin/awk -f~
cat bc|while read line
do
x=`wc -l bc|awk '{print $1}'`
for ( k=( NR + 1 ) ; k<=x ; k++ )
{
 if /$line/
 then
 sed 'k d' bc
 fi
}
done
You are defining the script as awk, but there is non-awk code in the script. Use #!/bin/sh or #!/bin/ksh or #!/bin/bash (depending on your shell).
Reply With Quote