[K12OSN] Scripting help...how to read lines from a text file
Roger
roger.in.eugene at gmail.com
Tue Oct 4 16:57:39 UTC 2005
On 10/4/05, David Trask <dtrask at vcsvikings.org> wrote:
> I understad 90%....one question...where do I indicate the filename?
> Here's what I believe it will look like, but I'm not totally sure where I
> indicate the path to the text file....
>
> #!/bin/bash
> cat $1 |while read LINE
> do
> echo "Processing $LINE"
> stop $LINE
> done
It's given in the command line:
scriptname filename
Or, instead of $1, you could sub the file name.
as in
cat filename |
More information about the K12OSN
mailing list