i'm currently new to bash and i have a tr1.sh script in a folder in the Desktop. but when i tried bash tr1.sh , sh tr1.sh , . tr1.sh or ./tr1.sh, and error will show
"li: command not found" . anyone can help. tnx
i'm currently new to bash and i have a tr1.sh script in a folder in the Desktop. but when i tried bash tr1.sh , sh tr1.sh , . tr1.sh or ./tr1.sh, and error will show
"li: command not found" . anyone can help. tnx
The script are trying to run a command named li, but you no app/tool installed with that name.
What's the content of the script?
This is my signature
you probably wanted ls but you shouldn't use ls for anything in scripts.
should do the trickCode:for f in *; do [ -f "$f" ] && mv -- "$f" "${f,,}"; done
[ -f "$f" ] is a test for being a file, just in case there are dirs you don't want to touch. If not, mv alone will do.
if your question is answered, mark the thread as [SOLVED]. Thx.
To post code or command output, use [code] tags.
Check your bash script here // BashFAQ // BashPitfalls
i solved it. i just mistyped ls into li
As Vaphell already mentioned it, you shouldn't use for i in $(ls). See BashPitfalls 01 (link in my signature). Also check out BashPitfalls 02 and 30 and http://mywiki.wooledge.org/CommandSubstitution .
Vaphell's solution should do the trick, but it can be improved. You only have to rename the files which have at least one uppercase letter:
For more examples you can check out BashFAQ 030.Code:for f in *[[:upper:]]*; do ...
Bookmarks