0

I have a shell script I'm trying to run, and it's not executing properly. I looked at run shell script, but it's not helping. The permissions on the file are (owned by me), -rwxrwxrwx, and also has _lpoperator, whatever that is. I ls /bin/sh and there's something there. (sh*)

Any ideas how to run this shell script?

Right now, I have myShellMac.sh down to this:

#!/bin/sh

pwd

cd ../darwin64_gcc42/bin

DEP_DIR=../depen

I've tried running it like sh myShellMac.sh, and get this error: : Command not foundsh: line2:. : Command not foundsh: line3: pwd. : No such file or directory 4: cd: ../darwin64_gcc42/bin : command not foundsh: line5:

I tried ./myShellMac.sh and get ./myShellMac.sh: Command not found.

I tried sh ./myShell.sh and get : command not found2.sh: line2: :command not found2.sh: line 3: pwd : No such file or directoryne 4: cd: ../darwin64_gcc42/bin : command not found2.sh: line 5:

It's trying to interpret every line, even the empty lines.

I also tried bash source ./myShell.sh and it said: : command not found : command not found : command not found : No such file or directory/bin : command not found

Community
  • 1
  • 1
Michele
  • 2,724
  • 10
  • 35
  • 62

1 Answers1

1

I figured out the problem. I edited the script in wordpad, and it changed the line endings through that to windows. So when I ran the script in the mac command line, it had problems with the line endings.

Michele
  • 2,724
  • 10
  • 35
  • 62