tell me what im missing, its not editing the file. but if i will run that on the server one by one. It works.
a couple of things:
1. server 1 is not the same as server1
2. I don't understand your sed line - it's not the same as I suggested. What's the meaning of \tom/?
3. shouldn't Connector port='8009' be Connector port="8009"?
4. are you trying to edit /home/user1/bb file on each server?
5. Given your expanded sample input, sed should probably look like: sed '/<Connector port="8009".*\/>/ s#.*#<!-- & -->#'
Try to debug and adjust the settings/script one line at the time modifying the sed regex based on your sample input - slowly, one thing at the time - no need to rush.
Once again, try to come with the proper sed expression for a local sample file representative of the end target file content BEFORE jump into the ssh-ing script.
Hi,
I have a specific requirement to add text at the beginning and end of a plain text file. I tried to use "sed" with '1i' and '$a' flags but these required two separate "sed" commands separated with "|".
I am looking for some command/option to join these two in single command parameter.
... (6 Replies)
I need to comment the lines starting with pattern "exclude" or "exclude=". If the work exclude comes at any other part, ignore it. Also, ignore, excludes, excluded etc. Ie only comment the line starting with exclude.
File contents.
exclude
exclude=
hi I am excluded
excludes
excludes=
... (9 Replies)
How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
Well here goes:
I tried to write a batch file that adds a specific fixed text to each line of an already existing text file.
for the adding text infront of each line I tried this:
for /F "delims=" %%j in (list.txt) do echo.STARTTEXT\%%j >> list.txt
for adding text after each line I... (0 Replies)
How can I specify special meaning characters like ^ or $ inside a regex range. e.g
Suppose I want to search for a string that either starts with '|' character or begins with start-of-line character.
I tried the following but it does not work:
sed 's/\(\)/<do something here>/g' file1
... (3 Replies)
Hello,
I have a file as follow
a
b
c
c
d
d
e
I would like to write a awk command to insert # from the first occurence of
"c" to the end of the files.
OUTPUT should be like this
a
b
#c (5 Replies)
Hello -
I am running Linux. I want to place a comment char at the beginning of a line in a file. For example:
testvar=`grep username /etc/people
sed -e 's/$testvar/#$testvar/g' /etc/people
I cannot get the above commands to put a comment at the beginning of the line.
Any... (3 Replies)
Hi, excuse me for my poor english.
My problem is that:
I have a File
i want to add to each line of that file two strings: one at the beginning of the line, one at the ending.
string1="abcd"
string2="efgh"
i want $string1 content $string2 for each line.
Is that possible? (3 Replies)
Is there an option, for cat, head, tail, or is there any way, to display a file from last line to first? For example, my file
looks like this:
aaaa
bbbb
cccc
eeee
and I would like to print or display it like this:
eeee
cccc
bbbb
aaaa
thanks (5 Replies)