Go Back

How do you solve this in Shell Scripting?

 Syntax error: word unexpected (expecting "do")

Here is my code
I want to look through all the folders in the current directory using Shell Script.

for d in */ ; do
    [ -L "${d%/}" ] && continue
    echo "$d"
done
Sent 893 days ago 11/13/2021 3:04:27 PM

You likely made the Shel script using a text editor and it put in there an extra character that you don't want. Do sudo nano myFile.sh and paste your content in there.

Sent 893 days ago 11/13/2021 3:28:51 PM


© 2024 - ErnesTech - Privacy
E-Commerce Return Policy