script wont run


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script wont run
# 1  
Old 02-10-2010
Network script wont run

Code:
$ ls -l
total 44
drwx------  2 ivanachu  users   512 Dec  6 19:15 VILEARN
-rw-------  1 ivanachu  users    74 Dec  5 18:42 cond
-rwx------  1 ivanachu  users    97 Dec  5 21:30 cond2
-rwxrwxrwx  1 ivanachu  users  4979 Feb 10 22:42 createHAqmgr.ksh
-rw-------  1 ivanachu  users    28 Dec  4 22:50 firstFile
-rwx------  1 ivanachu  users    56 Feb 10 22:37 kshHelloWorld
drwx------  2 ivanachu  users   512 Dec  5 03:30 lower1
-rwx------  1 ivanachu  users    73 Dec  4 23:17 perlHelloWorld
-rwx------  1 ivanachu  users   247 Dec  9 13:51 pucinella
$ ./createHAqmgr.ksh
ksh: ./createHAqmgr.ksh: No such file or directory
$

but this file definitely exists, as shown in the ls

another ksh (kshHelloWorld) can be sourced and run successfully.

Last edited by Scott; 02-10-2010 at 07:11 PM.. Reason: Code tags
# 2  
Old 02-10-2010
And if you say

Code:
ls -l createHAqmgr.ksh

?

What does the "shebang" look like?
Code:
$ ls -l Test
-rwxr-xr-x  1 scottn staff  31 11 Feb 00:13 Test

$ cat Test
#!/user/bin/k-ess-h
echo hello

$ ./Test
-ksh: ./Test: not found

# 3  
Old 02-10-2010
Please post the output from these two commands which are designed to find files with strange filenames:

Code:
ls -lab

ls -la | sed -n l

# 4  
Old 02-10-2010
shebang = #!bin/ksh

$ ls -l createHAqmgr.ksh
-rwxrwxrwx 1 ivanachu users 4979 Feb 10 22:42 createHAqmgr.ksh
$
I don't understand. The shebang in this file is the same as the shebang in the kshHelloWorld which runs ok. I guess I just don't understand sourcing.
# 5  
Old 02-10-2010
What do you get if you run the script with

Code:
ksh -x ./createHAqmgr.ksh

# 6  
Old 02-10-2010
running the script with
ksh -x ./createHAqmgr.ksh

and the script runs! what is going on?
# 7  
Old 02-10-2010
Your shebang is wrong...

Code:
#!bin/ksh

should be

Code:
#!/bin/ksh

Running the script as
Code:
ksh script.ksh

overrides the shebang, and as that works, suggest the shebang is wrong.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Apt-get update wont run and gives 503 service unavailable error

Hi, I am running on Ubuntu 12 (precise) 64 bit and came to know that i cannot install any packages using apt-get and aptitude. Linux test01 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux But the same /etc/apt/sources.list file is... (20 Replies)
Discussion started by: prash358
20 Replies

2. Shell Programming and Scripting

Shell script wont execute

Im using a script that writes a random line to a text file then executes another shell script. My problem is that the lottery shell script will not execute. Im not receiving an errors when running the shell script, and it copies a random line of text to mtest.txt fine. #!/bin/bash nscripts=2... (3 Replies)
Discussion started by: kylecn
3 Replies

3. Shell Programming and Scripting

Bash script wont exit?

Solved Stupidly I didn't put brackets around the , thanks for all the help guys if ps ax | grep Cluster__check.bash | grep -v grep > /dev/null -- fails (if ps ax | grep Cluster__check.bash | grep -v grep > /dev/null) --works (3 Replies)
Discussion started by: danmc
3 Replies

4. UNIX for Dummies Questions & Answers

Tcl script wont run in bash shell

Hello I'm having a problem running a TCL script in my new OpenSolaris OS. When I go to the directory containing my script called 'Install' (using the gnome terminal), it doesn't seem to be able to find it even though it lists it i.e. if I type "Inst" and hit tab to complete the word, it... (11 Replies)
Discussion started by: sbsbg
11 Replies

5. Programming

IO Error - xmal feed wont run

Keep getting IO Error and •nonnumeric port: '' (InvalidURL; misconfigured server?) This in relation to RSS feeds. We have done a load of work to try to get RSS feeds working. Now they work. But they wont validate. http://www.ukcitymedia.co.uk/news/rss.php?feed=New_News ... (0 Replies)
Discussion started by: alankeys
0 Replies

6. Shell Programming and Scripting

2 commands in script wont work together

For some reason when I run these separately they work but when they are in a script file the second wont: printf "%s\n" "$RANDOM"."$RANDOM" "$RANDOM"."$RANDOM" "$RANDOM"."$RANDOM" "$RANDOM"."$RANDOM" | tee $HOME/bpl/random RANDOM1=$( <$HOME/bpl/random ) Anyone know why? (8 Replies)
Discussion started by: pkohn11
8 Replies

7. Shell Programming and Scripting

My Wireless Script Wont Work.....anyone??

ive been trying to write a simple (at least i thought it was) script to launch my wireless usb under ubuntu with kde. im using nano. when i run it from a terminal it works fine, but it just wont run from the script. there is a caveat, but first heres the script. ... (7 Replies)
Discussion started by: braze
7 Replies

8. HP-UX

emacs wont run

hi i keep getting this error message when i try and run emacs: /usr/lib/dld.sl: Unresolved symbol: pthread_mutex_init (code) from ./emacs Abort any ideas? thanks ed. (4 Replies)
Discussion started by: deusprogrammer
4 Replies

9. Shell Programming and Scripting

script wont run from cron job

I have written a simple bash script that will run a wget command to recursively ftp an entire directories and it's contents. #!/bin/bash wget -r -N ftp://user:pass@server//VOL1/dir If I run from the regular command line it works fine. root@BUSRV: /media/backup1$ ./gwbu When I put it in... (1 Reply)
Discussion started by: mgmcelwee
1 Replies

10. Shell Programming and Scripting

why wont this script run?

i have this script i wrote, it chokes when running the add install client commandit keeps telling me the add_install_client command is incorrect. When I put the print statement in front of the command so it will echo it, the command looks right on the screen. Yes im am an ametuer, im trying to... (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies
Login or Register to Ask a Question