Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
need to use input file
Name: Robert Pearson Date: December 18, 2002 at 12:56:22 Pacific OS: solaris CPU/Ram: unknown
Comment:
I need to run the following command in a script, but I need to replace the 603528 with an input file.
Name: James Boothe Date: December 18, 2002 at 16:14:54 Pacific
Reply:
Since the loop will write multiple times to list.txt, it specifies a double right-angle bracket which will append. If a single right-angle bracket were used, each iteration of the loop would overwrite the contents. But to keep from appending the output to a previous execution, the script begins by removing list.txt.
#!/bin/sh rm list.txt 2> /dev/null for fname in `cat inputfile` do bpmedialist -ev $fname| grep 'Server Host'| awk -v fname=$fname '{print fname,$4}'>>list.txt done exit 0
0
Response Number 2
Name: Robert Pearson Date: December 23, 2002 at 12:22:02 Pacific
Reply:
This doesnt work. I get this error message. Any ideas?
awk: syntax error near line 1 awk: bailing out near line 1
FourSKY
0
Response Number 3
Name: James Boothe Date: January 4, 2003 at 07:35:14 Pacific
Reply:
Original awk did not support the -v option. On some platforms, the newer version of awk is nawk.
Summary: Hi All, I am quite new at unix script. I have two questions to ask for your help. 1) I will do quite a lot of experiments. The output file names of different experiments are different. In the post-pro...
Summary: Hi all! I am trying to come up with a script which will find all files created within a day and then chmod them to set the execute bit. Anyone got any ideas? I can come up with the files using find...
Summary: I need to sort an input file that the user can specify. 1: Ask the user for the name of the file 2: Verify that the file exists and is readable 3: issue a message if it's not readable 4: sort the inp...