I have a current code working(named subst1) having a user be able to type this line to substitute words using the sed command:
subst1 old-pattern new-pattern filename
Here is my shell script:
#!/bin/bash
# subst1
ARGS=3
E_BADARGS=65
if
then
echo "Usage: `basename $0`... (1 Reply)
Hello,
I have the following line in one of my shell scripts. It works fine when the search string($SERACH_STR) exists in the logfile($ALERTLOG) but if the search string does not exist this line errors out at run time. Is there a way to make this line return 0 if it is not able to find the... (4 Replies)
Hello,
i want to take the input from user and according to that variable's value search in file emp.lst. Here is what i came up with
echo -e "Enter string to be searched :\c"
read str
sed -n '/\$str/p' emp.lst
this is not working! any idea why?Thanks in advance! :) (4 Replies)
Hi Guru's,
I 'm trying to execute the below given script in Unix. I am having an issue with the script. The output of the script is given below:
#!/bin/bash
File_Home="/home/essftp/Risk"
cd /home/essftp/Risk
rm -f FileList
rm -f credit_risk*
file1=`ls -lt... (4 Replies)
First off I have read the man pages for sed and am still having trouble working on a script to remove portions of a log:
My goal is to take a log file to be emailed, read the file and strip the portions away AFTER the line MIME-Version:1.0
and strip away until it to the line starting with... (4 Replies)
Hi All,
I am trying to use a sed command in a shell script in order to delete some lines in a file and I got the following error message.
I don't understand why it is not working 'cause I have tried with simple quotes, then with double-quotes, and it is not working.
sed: -e expression #1,... (7 Replies)
Hello
i have a shell script which will go in some folders using for loop, build some programs with gcc and zip the output.
then i have to paste the file of that zip file into a yml file which will be further used by a ruby watir script.
PROJECT_PATH=/uploads/$PROJECT_FOLDER
zip -rq ... (0 Replies)
hi guys,
The following command doesn't seem to work in my shell script:
tag=$(sed -n '/${line}/ s/.*\.*/\1/p' myfile.txt)
When i replace the ${line} with an actual value, it works fine.
So, how do i use the ${line} in this sed command?
Thanks in advance,
Zaff (2 Replies)
Hi,
I have used expr command to increment the date.
for e.g.,
case 1 :
echo $(date -d $(echo `expr 20010101 + 1`))
it returns
Tue Jan 2 00:00:00 IST 2001
case 2:
echo $(date -d $(echo `expr 20010101 - 1`))
it returns
date: invalid date `20010100'
please suggest me, how to... (3 Replies)
I am using a shell script in fedora linux. While calling to the shell I am also passing an argument (var1=0.77) like shown below
sh gossip.sh var1=0.77
in the shell following command is written (which doesn't work)
sed - i -e 's@prob=@prob="$var1";//@g' file.txt
Actually i want the... (7 Replies)