Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multi line batch script problem

Status
Not open for further replies.

jjohnn

Technical User
Feb 11, 2003
43
US
I am copying an awk script from a book, trying to translate it to Windows XP from unix. It works if I put it all on one line in the script, but otherwise I get error messages referring to the line breaks. I tried ending the line with forward or backward slashes (a la C programming), but to no avail. Here is the script (script2.bat) that only runs on one line:
Code:
gawk -F, "{ print $4 \", \" $0}" 
| sort | 
gawk -F, "$1==LastState{ print \"\t\" $2} 
$1!=LastState {LastState=$1;
print $1;print \"\t\" $2}"
I invoke it with
C:> sed -f namestate list | script2

(I have a separate sed script that is operating on the file "list", with the results piped to script.bat)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top