SED command is not executing within the shell


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SED command is not executing within the shell
# 1  
Old 03-26-2008
SED command is not executing within the shell

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. Your help is highly appreciated.Thank you in advance.



exec auto_inv.4ge >KTI
sed 's/ //g' KTI > abc
exit
# 2  
Old 03-26-2008
exec replaces the shell with the command you use auto_inv.4ge. That command obviously does not understand sed.

In my understanding, exec is typically used to replace one shell with another. Example:
Code:
exec ksh

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Executing sed command inside a bash script

I want to run commands inside a bash script. An example is I want to pass the command in a string as regexp as an argument to the script, then run sed on the bash variable sed.sh regexp sed.sh "-i \"s/<p>//g\"" then call sed "$regexp" $fl (3 Replies)
Discussion started by: Kangol
3 Replies

2. Shell Programming and Scripting

Executing 'exit' command from shell script

Hi, I am writing shell script to automate few use cases for CLI interface. We have CLI interface which has bunch of commands. I am trying to execute one of the commands 'exit' as part of automation to exit from CLI object (not from shell script) in my shell script. My intension is to execute... (4 Replies)
Discussion started by: Mahesh Desai
4 Replies

3. UNIX for Dummies Questions & Answers

Cron shell script not executing diskutil command

I'm trying to learn how to use cron for repetative tasks. I have an external disk that needs to be unmounted and remounted every hour due to some problems that a backup utility (specifically, TimeMachine) is having repeatedly accessing the device. I've created a shell script that will find the... (3 Replies)
Discussion started by: illuminate
3 Replies

4. Shell Programming and Scripting

Problem in executing sed command

Hi, Input: XX = to_date ('9999-12-31 23:59:59', 'YYYY-MM-DD HH24:MI:SS') Required output: XX=to_date (\'9999-12-31 23:59:59\', \'YYYY-MM-DD HH24:MI:SS\') Regards Akshu (3 Replies)
Discussion started by: akshu.agni
3 Replies

5. Shell Programming and Scripting

executing command in a remote machine through ssh - shell script

Hi All, i have two machines like x and y . my requirement is i should connect to machine Y from x through ssh connection . and do some operation such as copy and move and delete files in Y machine . i tried with this code but it is doing in machine x only . and i need to exit from Y when... (1 Reply)
Discussion started by: rateeshkumar
1 Replies

6. Shell Programming and Scripting

Problem Executing Firmware Command using Shell Script

Guys, I have a script that should change one of the configuration Parameter in a http accelerator, this config change which will halt http traffic into device. So I have designed a script which should do these changes. But after executing this script, found that one of the input variable is not... (8 Replies)
Discussion started by: raghunsi
8 Replies

7. UNIX for Advanced & Expert Users

executing a command on parent shell

Hi, I am logging in from my PC terminal to a linux host using ssh. Is it possible to execute a command on the parent PC terminal from the linux host during login. NOte that the parent PC does not have sshd running. Sam (1 Reply)
Discussion started by: sardare
1 Replies

8. Shell Programming and Scripting

Error executing shell command from a perl script

Hi Gurus, I've a find command that gets the list of files from a source directory where the extension is not html, xml, jsp, shtml or htaccess. The below find command runs fine from the command prompt or in a shell script. I need to eventually run it in a PERL script and am getting the... (5 Replies)
Discussion started by: voorkey
5 Replies

9. Programming

Not able to see the inputted command on the shell prompt..but its executing the comnd

Hi , I m writing a program which involves piping(pipes). In my program, once i execute the child process (dealing with pipe),I m not able to see any inputted command on the screen....but the entered command is getting executed... Actaully inorder to implement piping i hav closed STDIN and... (3 Replies)
Discussion started by: Crab
3 Replies

10. Shell Programming and Scripting

Move command in the shell isnt executing...

-----------------------------------------------------------------------------Pls find my Q in the bottom--------------------------------------------- #!/bin/ksh #+---------------------------------------------- #| #| Usage: . scripts/run_all.ksh < scripts/run_all.txt #| #| This script... (2 Replies)
Discussion started by: thumsup9
2 Replies
Login or Register to Ask a Question