atira
April 30, 2013, 2:06pm
1
Hi
I'm new to scripting - please help me...
I'm trying to run a script written by a friend:
#!/bin/bash
for aStat in ....
do
....
done
when coping the script to the terminal I get:
/bin/bash: Event not found.
for: Command not found.
do: Command not found.
I read the post recommending this:
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
however still I got:
export: Command not found.
what am I doing wrong?
Thanks alot!
It could be bash's history expansion. It tries to expand the exclamation mark. Try switching it off first:
set +H
atira
April 30, 2013, 3:02pm
3
I got:
set: Variable name must begin with a letter.
Thanks for the fast response.
If relevant I'm working on Mac OS10.68
Your terminal runs csh or tcsh.
Switch to bash with
exec bash
1 Like
clx
April 30, 2013, 3:23pm
5
Just for a chance, can you try #! /bin/bash
instead of #!/bin/bash
?
A space between "!" and "/"
What do you mean? You don't "copy a script to a terminal". In case helpful, in case you are really "copying script to terminal": The script lives in a file. You set execute permission on the file, and run the file as a command.
RudiC
April 30, 2013, 4:18pm
7
Pls post what shell you're using, and the entire scipt including the error messages, having confidential/proprietary/classified data scrambled.
atira
April 30, 2013, 5:27pm
8
thanks alot.
That made lots of things clear!
---------- Post updated at 04:27 PM ---------- Previous update was at 04:26 PM ----------
wow, I'm really impressed from the number of helpful responses
Thanks!