-1

I have a shellscript that is having trouble finding a file. The text file exists so I don't understand what the issue is.

#!/bin/ksh
goodmain $1 | sed -e '1,/mmxxaa/d'

$ ls -l
total 1364
-rwxr-xr-x. 1 s student  94563 Apr 23 23:55 a.out
-rwxrwxrwx. 1 s student     19 Apr 28 17:13 boo
-rw-r--r--. 1 s student     89 Apr 24 00:58 cookies
-rw-r--r--. 1 s student   1622 Dec  6 23:49 doc
-rw-r--r--. 1 s student    148 Apr 23 16:14 textfile
-rw-r--r--. 1 s student 597061 Apr 23 23:56 fn
-rwxr-xr-x. 1 s student  94563 Apr 28 16:56 goodmain
-rw-r--r--. 1 s student 427993 Apr 23 23:47 main.c
-rw-r--r--. 1 s student 145256 Apr 24 00:40 main.o
-rw-r--r--. 1 s student     72 Apr 28 16:53 makefile
-rwxrwxrwx. 1 s student     46 Apr 28 17:24 p4
$ ./p4 textfile
./p4: line 2: goodmain: not found
cokedude
  • 1,121

1 Answers1

1

Since the current path is not in the PATH variable, you have to specify completely the location of the file: you can add "./" if your file is in the same location as the script or you can give the full path:

./goodmain

Or:

/full/path/goodmain
gapz
  • 331