so i'm writing script compares file names in different directories. wrote this:
for name in `ls <directory>` folder in `ls <directory 2>` if [[ “$name” == “$folder” ]] echo “these names same" else echo "these names different" fi done done
basically have file in 1 area (ie desktop) named abc. have folder in area (ie in documents) named abc. script should recognize them same , display "these names same." if folder named xyz however, display "these names different."
when tried on mac though, script did not work. however, when had else write same script on linux os, script able recognize same/different names.
is there syntax thing messing up? learned these commands in linux context, possible doing wrong.
Comments
Post a Comment