/bin/sh: : not found error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting /bin/sh: : not found error
# 1  
Old 10-27-2013
/bin/sh: : not found error

Hello,

When i run the shell script in Solaris, i am getting the below error.

/bin/sh: Test.sh: not found

I have tried including "#!/bin/bash" , did not work,
tried with #!/bin/ksh , did not work,
tried without the above include in the script, but still did not work.

Please help me to find the solution for this.

Thank you.
# 2  
Old 10-27-2013
Show us your script.
# 3  
Old 10-27-2013
I have tried with..
==============
#!/bin/bash

echo "1, cronjobs check"

echo "2, cronjobs check"
================

and , 2nd script like,
==========
echo "1, cronjobs check"

echo "2, cronjobs check"
=======

In the same server, same script is working fine with another user.
# 4  
Old 10-27-2013
if the script is not in your path then you may get this error message.
you must precede with ./ when executing the script from the current working directory.
verify that it has execute permission. if not,
run this command to give execute permission
Code:
chmod +x test.sh

# 5  
Old 10-27-2013
Are you running this from the cron ? if so, you may need to define the bash profile at the top of the script for the user running. Add this line to the top of the script (after hash bang line):

Code:
 . ~/.bash_profile

# 6  
Old 10-27-2013
Have you tried the obvious:-
Code:
ls /full/path/to/*sh*

To see what you have got...

Last edited by wisecracker; 10-27-2013 at 04:30 PM.. Reason: Modified to full path.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Open Source

/usr/bin/sh xlc not found

Hi Everyone, We are trying to compile Kerberos library using xlc and we get an error that xlc is not found in the system. We tried using gcc as well but it also fails with the same error. We could not find the compiler in the software media we received from IBM. Any inputs on how... (2 Replies)
Discussion started by: madhav.kunapa
2 Replies

2. Shell Programming and Scripting

/bin/bash: Event not found.

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. (7 Replies)
Discussion started by: atira
7 Replies

3. AIX

/usr/local/bin/cvs: Not found

I can able to access /usr/local/bin/cvs in the terminal (AIX 6.1 Box). but i am getting the "/usr/local/bin/cvs: Not found " when i call it from the script. please some one assist me what maybe problem (6 Replies)
Discussion started by: hifirockz
6 Replies

4. OS X (Apple)

When to use /Users/m/bin instead of /usr/local/bin (& whats the diff?)?

Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself. But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Discussion started by: michellepace
1 Replies

5. Debian

exec: 193: ./firefox-bin not found

Hi, all. When I run iceweasel as normal user in squeeze, I got forrowing message. exec: 193: ./firefox-bin: not found I think this is readlink problem, because ... #cat /usr/bin/iceweasel line 40........... MOZ_APP_LAUNCHER=$(which $0) MOZ_DIST_BIN= $(dirname $(readlink -f... (3 Replies)
Discussion started by: miru
3 Replies

6. Shell Programming and Scripting

#!/bin/bash and #1bin/sh command not found error on mac osx terminal/shell script

i am having a weird error on mac os x running some shell scripts. i am a complete newbie at this and this question concerns 2 scripts. one of which a friend of mine wrote (videochecker.sh) a couple weeks ago and it's been running fine on another machine. then last week i wrote capture.sh and it... (2 Replies)
Discussion started by: danpaluska
2 Replies

7. Infrastructure Monitoring

HPUX net-SNMP interpreter "/bin/perl" not found

I am trying to install net-snmp on an HPUX box. I am getting the fallowing error message when I try to run the snmpconf file. I installed the fallowing version of net-snmp net-snmp-5.0.10.2-HP-UX_B.11.11_9000_800.tar and my HPUX box is version HP-UX commnms B.11.11 U 9000/800... (2 Replies)
Discussion started by: krisarmstrong
2 Replies

8. Shell Programming and Scripting

/bin/ksh: scriptname: not found. ???

I have started to write Korn scripts on the client's AIX 4.2 servers and there is this small problem that puzzles me. I code all my scripts the same way: - first line contains : #!/bin/ksh - I do this console command on every scripts: chmod +x scriptname But still, on some occasions,... (4 Replies)
Discussion started by: Browser_ice
4 Replies

9. UNIX for Dummies Questions & Answers

fuser: difference with bin/sh and bin/ksh shell script

Hi, I have a problem I don't understand with fuser. I launch a simple shell script mysleep.sh: I launch the command fuser -fu mysleep.sh but fuser doesn't return anything excepted: mysleep: Then I modify my script switching from #!/bin/sh to #!/bin/ksh I launch the command fuser -fu... (4 Replies)
Discussion started by: Peuj
4 Replies

10. AIX

nim mksysb error :/usr/bin/savevg[33]: 1016,07: syntax error

-------------------------------------------------------------------------------- Hello, help me please. I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? : Command : failed stdout: yes stderr: no... (9 Replies)
Discussion started by: astjen
9 Replies
Login or Register to Ask a Question