![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 |
| crontab + exec command | naushad | Shell Programming and Scripting | 4 | 03-27-2008 12:23 AM |
| Help with exec command and file descriptors?? | rfourn | Shell Programming and Scripting | 1 | 07-18-2007 03:05 PM |
| find command exec error | pavan_test | UNIX for Dummies Questions & Answers | 2 | 06-13-2006 12:58 AM |
| exec command | g_s_r_c | Shell Programming and Scripting | 1 | 09-20-2004 09:20 AM |
| using the -exec command | moxxx68 | UNIX for Dummies Questions & Answers | 0 | 04-13-2004 11:51 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
Quote:
I took your advice and retyped. Still getting the same error. If I type the command it works. If I run it from the ksh script I get the error: find: missing argument to `-exec' |
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
Hello,
I really still need some help in getting this script to work. If I type out the command it works. If I put the exact same command in a .ksh script, I get the error: Find: missing argument to `-exec`. Why would it do this in the script and not at the command line? |
|
#10
|
|||
|
|||
|
First question:
Does the first line of the script look like this? Code:
#!/bin/ksh does the output of this show any weird characters on the problem line Code:
od -c myscript.sh |
|
#11
|
|||
|
|||
|
Or a workaround
Code:
find /dir1/dir2 -type f -name "FILE.*" -newer /dir1/dir2/afterme.txt | \
while read filename
do
cp $filename /dir1/dir2/dir3/
done
|
|
#12
|
|||
|
|||
|
I'm with Jim on this. The .ksh extension does not at all effect which shell will be invoked. If it's a sh with a different PATH than you run interactively, you could be getting another version of find than you get at the command line. Another thing to watch out for is DOS carriage returns in the script. You're not writing it on a Windoze machine and uploading it to your Unix account, are you?
|
|
#13
|
|||
|
|||
|
No, I used vi to create the file. I had the #!/bin/ksh at the top of the line but I was getting this error:
: bad interpreter: No such file or directory |
|
#14
|
|||
|
|||
|
Quote:
Here is the error I get when I run the above from the script: : command not founde 1: ./scriptname.ksh: line 7: syntax error: unexpected end of file I just don't get it. From the command line it works. From ./scriptname.ksh ERROR! |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|