Funny but true....


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Funny but true....
# 1  
Old 03-26-2008
Funny but true....

Hallo everybody

I am having a shell script called auto_run.sh in that only the first line works.
the second line which has sed command is working only at the # prompt. not within the shell script. What could be the reason.

*... sed 's/ //g' KTI >abc works in another shell script without the first line.when i add the exec....statement it stops working. Please can anyone help me.Thanks


exec auto_inv.4ge >KTI
sed 's/ //g' KTI > abc
exit
# 2  
Old 03-26-2008
Try this and tell me whether now the shell script works are not

exec auto_inv.4ge >KTI
sed 's/ //g' ./KTI > abc
exit
# 3  
Old 03-26-2008
no it didnt work,only file KTI was created.
# 4  
Old 03-26-2008
invoke a shell before exec

Use a shell invocation before exec as below.

Code:
ksh
exec auto_inv.4ge >KTI
sed 's/ //g' KTI > abc
exit

Replace ksh with whatever shell you are using.
# 5  
Old 03-26-2008
No sorry to bother you no luck at all
# 6  
Old 03-26-2008
Try prefixing exec command with sh.

Code:
sh exec....
sed..
exit

The problem is after exec, the shell is exiting. Hence further commands are not executed.

You can also try providing absolute path for KTI.
# 7  
Old 03-26-2008
Thank you very much for your time and sharing your knowledge. It worked perfectly. thank You once again.Bye
 
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. What is on Your Mind?

Funny *NIX commands

Hello All, Just want to share some funny *NIX commands :). $ make love make: *** No rule to make target `love'. Stop. On a FreeBSD make: $ make love Not war. $ \(- bash: (-: command not found $ man woman No manual entry for woman $ touch /me touch: cannot touch `/me':... (5 Replies)
Discussion started by: RavinderSingh13
5 Replies

2. What is on Your Mind?

Old, but still funny

Annoyances.org - Upgrading to Wife 1.0 (0 Replies)
Discussion started by: jgt
0 Replies

3. What is on Your Mind?

Very Funny - Had to laugh

Guys, This is funny. http://i28.photobucket.com/albums/c228/jralph2005/bart.png jaysunn (2 Replies)
Discussion started by: jaysunn
2 Replies

4. What is on Your Mind?

Funny things from FunnyJunk

Just one i like. Missing Cat! ! ! (0 Replies)
Discussion started by: Action
0 Replies

5. Shell Programming and Scripting

Echo working funny

Hello, this is my first post and question. I have search before for this problem but didn't find anything similar. My case: I have a string inside the variable string1 like this: string1="lala lele lili lolo lulu" When I do echo of it, it appears like this: echo $string1 lala lele lili... (8 Replies)
Discussion started by: hemtar
8 Replies

6. What is on Your Mind?

Funny Quotes-UNIX

If you people find something funny like these go ahead and post it :) (5 Replies)
Discussion started by: vidyadhar85
5 Replies
Login or Register to Ask a Question