script wont run

$ 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.

And if you say

ls -l createHAqmgr.ksh

?

What does the "shebang" look like?

$ 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

Please post the output from these two commands which are designed to find files with strange filenames:

ls -lab

ls -la | sed -n l

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.

What do you get if you run the script with

ksh -x ./createHAqmgr.ksh

running the script with
ksh -x ./createHAqmgr.ksh

and the script runs! what is going on?

Your shebang is wrong...

#!bin/ksh

should be

#!/bin/ksh

Running the script as

ksh script.ksh

overrides the shebang, and as that works, suggest the shebang is wrong.

$ ls -lab
total 96
drwx------    4 ivanachu  users    512 Feb 10 22:46 .
drwxr-xr-x  227 new       wheel  10752 Feb 10 13:44 ..
-rw-r--r--    1 ivanachu  users    878 Dec  4 20:01 .history
-rw-------    1 ivanachu  users   2703 Dec  4 20:52 .profile
-rw-------    1 ivanachu  users   3188 Dec  4 20:04 .profile.save
-rw-------    1 ivanachu  users     82 Dec  4 17:56 .signature
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
$

I don't know if this is the problem but you're missing a slash. It should be:

#! /bin/ksh

I apologize for my shell script ignorance and thank you for the help.

And I apologise for asking what the shebang looked like, and then being blind enough not to see the missing slash first time round :smiley: