Strange behavior
I have these lines in a file called rogue.txt:
atd bash -bash bdi-default boa cleanup I search through the file one line at a time looking to see if one of the words is therein: Code:
#!/bin/bash Thanks. |
This works fine. Firstly please place code within [code][/code] tags.
My contents of rogue.txt are the same as yours. My contents of test.txt is the word bash. The script as I've copied it, but note that I've indented as well as put in #!/bin/sh, I called it sear.sh: Code:
#!/bin/sh Code:
~/testcode$ ./sear.sh Another suggestion is to put the following near the top of your script to enable debugging output: Code:
set -xv |
I put in the entire code above. Never seen set -xv, pretty nice debugging process.
|
Quote:
|
I resemble that remark: "Bash Scripting for Dummies" :)
Thanks (I think?). |
"AND Geniuses" ... :)
Just toss yourself in the "other" pool. Glad you got it working, and yes "set -xv" is extremely useful. |
All times are GMT -5. The time now is 06:59 AM. |