exec script error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting exec script error
# 1  
Old 05-11-2011
exec script error

Hi, Gurus,
my script code as following:
Code:
#!/usr/bin/sh
mkdir dir1
result=`echo $?`
if [ $result -eq 0 ]; then
echo "completed"
else
echo "wrong"
fi

When I execute it with command
Code:
sh filename.

, it executed successfully.
but, when I execute it with command
Code:
. filename

it throw out error:
Code:
-bash:ELF    : command not found

my env:
Code:
echo $SHELL
/bin/bash

SmilieSmilie
anybody has some idea ?

Thanks in advance
ken002
# 2  
Old 05-11-2011
can you try . ./filename ?
This is just explicitly specifying file in the current directory...
This User Gave Thanks to roger67 For This Post:
# 3  
Old 05-11-2011
Quote:
Originally Posted by roger67
can you try . ./filename ?
This is just explicitly specifying file in the current directory...
Yes, It works. Thanks
Would you please explain little bit the reason?

Thanks in advance
ken002
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Executing perl script in Linux gives :Exec format error. Wrong Architecture

i have perl script that used to be working great , once i edit it in windows and convert it to UTF-8 and then via FTP return it . also did: chmod +x foo.pl and then when i try to run it : ./foo.pl im getting this error: ./foo.pl: Exec format error. Wrong Architecture.... (4 Replies)
Discussion started by: umen
4 Replies

2. Shell Programming and Scripting

Use of exec command in a script

Guru's, I want to make a use of "exec" command in my script and want to check return code of executing script, but as you know exec command will terminate current processID and comeout and will trigger new one, i am unable to check return code of script and not able to run a scrpit after exec. ... (2 Replies)
Discussion started by: pawar.atul28
2 Replies

3. Shell Programming and Scripting

Script Variables Inquiry, Values Okay in Standalone Exec, No-Show in Cron Exec

I have the following bash script lines in a file named test.sh. #!/bin/bash # # Write Date to cron.log # echo "Begin SSI Load $(date +%d%b%y_%T)" # # Get the latest rates file for processing. # d=$(ls -tr /rms/data/ssi | grep -v "processed" | tail -n 1) filename=$d export filename... (3 Replies)
Discussion started by: ginowms
3 Replies

4. Shell Programming and Scripting

using rm with find -exec gives error

Greetings, Everytime I use rm with find I get errors like find: ./test: No such file or directory For exemple : hostname> mkdir test hostname> ls test hostname> find . -type d -name test -exec rm -rf {} \; find: ./test: No such file or directory hostname>ls hostname> echo $? 1 ... (2 Replies)
Discussion started by: Sekullos
2 Replies

5. Shell Programming and Scripting

EXEC error

Hi, In my script i need to output the STDOUT and STDERR messages to a log file. my code is as below. ------------------------------------------------------------------------ LogDate=`date "+%Y%m%d"` LogDirectory=`grep -w LogDirectory ${ParameterFile}|cut -d "=" -f2`... (1 Reply)
Discussion started by: Raamc
1 Replies

6. UNIX for Dummies Questions & Answers

find .... -exec rm .... \; works, but gives an error

I am using find to get all the instances of a given directory name, then remove those directories with a -exec rm command. here is an example: mkdir -p foo/bar find foo -name bar -exec rm -rf {} \; foo will get deleted as I desired, however this pops out on standard error: find: foo/bar:... (3 Replies)
Discussion started by: Afifi
3 Replies

7. Shell Programming and Scripting

using -exec in a script

I am using a third party job management program called Autosys. the command to load a jil into the autosys database is jil < somefilename.jil I have a directory and it in are a lot of jils. rather than type jil < somefilename.jil for every file I would like to script something do do it. if cd... (2 Replies)
Discussion started by: jayjabour
2 Replies

8. UNIX for Advanced & Expert Users

UNIX Backup Exec Agent Error

Hello, When launching a recently installed UNIX agent for my Veritas backup exec server I receive "getservbyname (grfs, tcp) failed!" I have checked to make sure the service exists under port 6101 and its there. I also removed and recreated the service but still no go. :confused: :confused:... (2 Replies)
Discussion started by: George26
2 Replies

9. UNIX for Dummies Questions & Answers

find command exec error

Hi All, i am writing a shell script in korn shell which deletes all the files in a directory once in every 10DAYS. the directory has different format files. the script has something like this; cd /home/data/pavi echo "Please Enter the Number of Days to search for" read DAYS... (2 Replies)
Discussion started by: pavan_test
2 Replies

10. AIX

Exec of 'dbupgrade' returned non-zero status of '0x1' error

After upgrading to IS 4.0 Sp4 I am now recieving an error when running initfnsw start Exec of 'dbupgrade' returned non-zero status of '0x1' This error appears right after trying to start the Oracle Database. This stops the FileNet software from starting. After many different attempts at... (0 Replies)
Discussion started by: jderocco
0 Replies
Login or Register to Ask a Question