grep doesn't need cat to read files, it can open them it's self. No need for perl or awk, sed can find and replace text.
Try this updated script:
Code:
select env in dev stg qa
do
if [ $env != "" ]; then
echo "SELECTED ENVIRONMENT IS : $env"
break
else
echo "Illegal selection."
fi
done
echo " "
Line3=`grep ^ws.rsp.url= properties`
echo "Current rsp url is as follow.Please make selection carefully"
echo $Line3
echo " "
echo "Would you like to add any "stg dev qa " tip to point rsp url (y/n)?"
read yn
case $yn in
[Yy]*)
rsp=`sed -n '/^ws.rsp.url=/s/^[^-]*-\([^.]*\)\..*/\1/p' properties`
echo $rsp
echo $env
sed "/^ws.rsp.url/s:$rsp:$env:" properties > /tmp/properties.$$
mv /tmp/properties.$$ properties
LINE12=`grep ^ws.rsp.url properties`
echo "changed rsp url as below"
echo $LINE12
;;
[Nn]*)
echo "As per you selection it's not required to change rsp url"
;;
*)
esac
echo " rsp url is ready now"
Hi,
I am trying to attach a .log file or .txt file to mail command to send an email once my ksh script executed. I am unable to use mutt command as it has been not installed and i am not supposed to install it. I have tried many ways by googling which has not helped me to succeed.
Here is my... (5 Replies)
Hi,
I want to do caseless string comparision using test command
for eg: Ind_f="y"
test "$Ind_f" == "y|Y"
i tried , ** , nothing worked.
any thoughts on how to do case insensitive string comparison using test command without converting to any particular case using typeset or tr? (8 Replies)
I just installed the latest version of ubuntu and I can't run the update manager without getting an error message. Im not sure what info i need to post so i can get help so just tell me if i need to post info because i would like to use ubuntu. (2 Replies)
Hi All,
Need to convert file names to upper case using tr command in Unix.
In a folder -> /apps/dd01/misc
there are two files like:
pi-abcd.pdf
pi-efgh.pdf
The output of should be like:
pi-ABCD.pdf
pi-EFGH.pdf
I have used the command to work for a single file at a time... (3 Replies)
please explain this update to the webcache.xml file ( attached)
sorry i come from a windows env
thank you
*************
echo -n "7. Updating webcache.xml file..."
set line_num = `grep -n "</CACHEABILITY>" $ORACLE_HOME/webcache/webcache.xml | tail -1 | cut -d : -f 1`
head -`expr $line_num... (0 Replies)
Hi Everyone,
Each time I do update the crontab, it gets reset after exiting from the telnet session. I'm using Solaris 2.8
So it goes like this:
Step 1: Login as root, from a telnet session
Step 2: Crontab -e (I make modification)
Step 3: Save and exit
Step 4: Type crontab -l , changes... (4 Replies)