bash vs tcsh versioning ?
HI !
I am desperate. I got a little bash script. On my PC it runs ok, I testet it in bash and tcsh shells. The problem is that when I run it on other,remote shells; Here are some first lines from it. Code:
usage() Quote:
But if I provide him 2 arguments, as it expected and run Code:
sh puishor.sh pcr6.1 Q01171801-07 Code:
puishor.sh: test: argument expected Could someone help me please... at least clue me what is problem in ? |
How do you run it as a remote shell ?
|
Quote:
I copy on that machine my script ( through ftp GUI client, using the same user ID and password) And there I execute it, using sh command. Is that you asked me ? |
Quote:
Actually, you do not run your script remotely but locally on another host, but nevermind. You should add a first line telling the O/S what interpreter to use to execute your script: e.g.: Code:
#!/bin/bash Code:
#/bin/bash Code:
$ sh scriptName Code:
$ chmod +x scriptName |
That works.jlliagre,thank you very much.
I still got one question. What is the difference between how do I run my script by "sh myscr"" or by "./myscr" ( with "chmod +x myscr" before that ) ? Isn't the result the same ? |
Quote:
|
There is also another way to execute a shell:
Code:
. ./myscr |
Beware that when using the source or "." command to run a shell script, an exit command in it will log you out ...
|
All times are GMT -5. The time now is 01:02 PM. |