Quote:
On my computer the script file is named /home/daniel/Desktop/LQfiles/dbm942.bin and the input file is named /home/daniel/Desktop/LQfiles/dbm942inp.txt You would choose different names. I run the program by launching a terminal session and entering: bash /home/daniel/Desktop/LQfiles/dbm942.bin Here is my script, in it's entirety. Note that it contains two versions; you would use either one. Daniel B. Martin Code:
#!/bin/bash |
well that certainly makes it run
but i have used some awk scripts that start out with an awk command, usually awk -F, and then i chmod them to be executeable and then run them by Code:
awk_script_name input.dat > output.dat |
Quote:
I know that it is possible to write a pure awk program and execute it as such, but I've never done that and don't know what advantages there are (if any) to doing so. I do programming as a recreation and am entirely self-taught in Linux. I use a bash shell and have no reason for this other than I've followed the example of other programs posted on this site. Using bash lets me use awk and pipe it with other Linux commands such as grep, sed, cut, paste, etc. I wrote the version "Method #3" for you, in case you know awk but are not familiar with nl and sed. Daniel B. Martin |
All times are GMT -5. The time now is 08:34 AM. |