I have a Problem with sed command.
I want to replace a defined string with a string from a database field (dynamic).
e.g.
The Problem is that the $HNAME variable can contain Special characters like '&'
e.g.
so I get the Output
sed replace the ampersand with the searchstring.
Is it possible to tell sed not to modify the replacestring?
I want to write a sed command that does the following work:
file: <a>asdfasdf<\s>
<line>hello</line>
<b>adf<\c>
<b>tttttttt<\c>
output:
name=hello
sed -e 's/^*//' -n -e '/<line>/s/<*>//gp;' -e 's/^/name="/g' file
but I can not append "=" after getting the line with... (5 Replies)
Hi
I am having a 'grep' headache
Here is the contents of my file:
(PBZ,CP,(((ME,PBZ,BtM),ON),((ME,((PBZ,DG),(CW9,PG11))),CW9,TS2,RT1)))
I would like to count out how many times 'PBZ' occurs and then place that number in the line above
3... (8 Replies)
Please explain the usage of ampersand in the following command
who & echo "Total number of users are `who|wc -l`"
What I understand is that ampersand is used to run some process in the background. And, what I am expecting from this command is
"Output of who should be displayed on the... (2 Replies)
Experts,
We used to receive our source files with '~^' as row delimiter. This file contains 2500K records and two of the columns having value in HTML formats within the file.
While running the below commands against the file, we are encountering out of memory, could you please help to... (3 Replies)
I need a script to to instert the following line into my postfix master.cf file:
flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} -- ${recipient}if I use echo I get the line truncated:
:~ echo flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} -- ${recipient}... (3 Replies)
I'm new using Unix commands in applescript. The following script you choose different folders with PDfs, get file count of PDfs on chosen folders, & write the results in text file.
set target_folder to choose folder with prompt "Choose target folders containing only PDFs to count files" with... (0 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
After using the egrep command to pull certain lines from the asg5f1 (creating the asg5f1c file), I am required... (1 Reply)
My objective is to check the value of a variable which I will set it in the command line after sleep time mentioned in the script.I have executed my script in the background then pressed Enter.I have set temporary variable like below export PAUSE="PAUSE".I am not getting the value of the variable... (3 Replies)
I want to add the character "<" to the end of each line of input using the & function in SED.
Something like:
sed 's/.*/&\</'
It's important to use the &, not another method, because I want to know what I'm doing wrong.
Thanks (5 Replies)
For years I have spawned shell scripts with nohup and ampersand and they run whether or not I stay logged in. Recently a client told us that we had to set a keep alive timeout on all of our Redhat 7.6 Linux servers. Our sysadmin set the following parameters in the sshd_config file on all of our... (10 Replies)