10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Looking to add text to a file, example
File example;
nodegroups:
check-hosts: L@host.domain.com,host2.domain.com,host3.domain.com
I need to take a file with a one line list of hosts separated by commas
host.domain.com,host2.domain.com,host3.domain.comand prepend the string " ... (6 Replies)
Discussion started by: bash_in_my_head
6 Replies
2. Shell Programming and Scripting
The following command works echo "some text with spaces" | sh -c 'sed -e 's/t//g''But this doesn't and should echo "some text with spaces" | sh -c 'sed -e 's/ //g''Any ideas? (3 Replies)
Discussion started by: Tribe
3 Replies
3. Shell Programming and Scripting
Hi,
I have a file with email header information. I would like to change the Subject line.
Subject: ** PROBLEM Host Alert: server.domainname is DOWN **
I'd like to change this line such as to look,
Subject: serverID ACK Fw: ** PROBLEM Host Alert: server1.domainname is DOWN**
How can I... (2 Replies)
Discussion started by: upengan78
2 Replies
4. Shell Programming and Scripting
It's been covered in lots of places, and I have banged on it for about an hour and I am not making any headway on this particular string.
A weather-related web page I want to monitor has text on the screen, but it changes. Right now, the page has "None issued by this office recently." but in 2... (4 Replies)
Discussion started by: Habitual
4 Replies
5. Shell Programming and Scripting
if the answer is obvious, sorry, I'm new here.
anyway, I'm using tr to encrypt with rot-13:
echo `cat $script | tr 'a-zA-Z' 'n-za-mN-ZA-M'` > $script
it works, but it removes any consecutive spaces so that there is just one space between words. I've had this problem before while using sed to... (5 Replies)
Discussion started by: Trichopterus
5 Replies
6. Shell Programming and Scripting
SHELL SCRIPT
Hi
I have a file in the following format
Mayank Sushant
Dheeraj Kunal
ARUN Samir
How can i replace the white space in between and replace them with a comma?? The resultant output should be
Mayank,Sushant
Dheeraj,Kunal
ARUN,Samir
i tried using
sed -e... (8 Replies)
Discussion started by: mayanksargoch
8 Replies
7. UNIX for Dummies Questions & Answers
Anyone know how to represent tabs when doing subsitutions in sed? I have tried using \t but it doesn't seem to work. (11 Replies)
Discussion started by: handak9
11 Replies
8. Shell Programming and Scripting
Hello and thx for reading this
I'm using sed to remove only the leading spaces in a file
bash-280R# cat foofile
some text
some text
some text
some text
some text
bash-280R#
bash-280R# sed 's/^ *//' foofile > foofile.use
bash-280R# cat foofile.use
some text
some text
some text... (6 Replies)
Discussion started by: laser
6 Replies
9. UNIX for Dummies Questions & Answers
If have a problem with this command:
name="toe der"
echo $name | sed -e 's/]//g'
it will become:
toeder
how to make it back to original? (7 Replies)
Discussion started by: elenatec
7 Replies
10. Shell Programming and Scripting
Hello,
I have the following to remove spaces from beginning and end of a string.
infile=`echo "$infilename" | sed 's/^ *//;s/ *$//`
How do I modify the above code to remove spaces from beginning, end and in the middle of the string also.
ex:
... (4 Replies)
Discussion started by: radhika
4 Replies