Another non-working script
Doesn't work:
Code:
#!/bin/bash Above is an edit of: Code:
#!/bin/bash Konsole execution error is Code:
line 14: : No such file or directory Code:
n /home/steve/bin/addsupcats line 16: Carver |
Moving this to Programming to get your question better exposure.
Recommend you use "set -xv" to add debug inline in your script. I realize you used shellcheck, I've never used that and don't know how helpful it is. You can even insert a "set -xv" before line 16 and then a "set +xv" after line 16 to minimize the debug output. |
The shellcheck message is a warning to advise of good habits, so can be ignored if you don't believe this is an issue.
Where are you expecting the 'item' variable to be populated from? I would add that there is nowhere in the first script presented that populates the 'thef' variable that the while loop is trying to read from. The second script does but then I am back to my first question as the assignment is based on 'item' being populated. |
you can read a description about all the shellcheck messages like this: https://github.com/koalaman/shellcheck/wiki/SC2162 (just replace SC-number at the end). This will explain why -r is recommended and when can you omit or ignore it.
Just an additional remark to shellcheck: shellcheck cannot check if your script really works, so no errors does not mean your script is ok. It means only there were no semantic problems found. You can also use set -xv as it was already suggested (for debugging), and additionally you can use set -u and set -e too. |
Yes, I see where 'thef' stays empty (mistake now remedied)
Quote:
Quote:
|
I made the corrections and they worked. Marking thread as solved.
|
All times are GMT -5. The time now is 06:00 PM. |