![]() |
|
|
|
|
|||||||
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search a list of lines in file into files | sriram003 | UNIX for Advanced & Expert Users | 2 | 05-20-2008 04:23 AM |
| how to List out the Files based on the file Size...? | psiva_arul | Shell Programming and Scripting | 6 | 04-08-2008 07:06 PM |
| Using File Descriptors, traverse a list | MaestroRage | UNIX for Dummies Questions & Answers | 2 | 02-12-2008 03:05 PM |
| ksh: How to get latest file from a list of files in a directory | Jayathirtha | Shell Programming and Scripting | 1 | 06-24-2003 07:23 AM |
| filesize from a file which has the list of files. | yls177 | UNIX for Dummies Questions & Answers | 3 | 04-10-2003 08:30 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
hello,
I have written a script named listall.sh with the following codes init. #!/bin/bash PATH="/proj/cmon/$1" echo $PATH if [ $# != 1 ]; then echo "Usage: $0 ***" exit 1 else ls -l $PATH/*.sc fi Here there are 3 subdirectories (namely - src, data and jobs)under /proj/cmon, so if give something like "listall.sh src", it should list all the files in path "/proj/cmon/src", but I was getting listall.sh: line 8: ls: command not found. somebody please help me. |
| Forum Sponsor | ||
|
|
|
|||
|
The PATH variable is special to the shell; by resetting it, you are preventing it from finding its regular binaries, such as /bin/ls. Use a different variable name (or, theoretically, use full path names to all binaries you need to use in your script).
|
| Thread Tools | |
| Display Modes | |
|
|