02-24-2009
i didnt really get this
my script is like this
#!/bin/bash
if [ $# -lt 3 ] ; then
echo -e "Wrong number of parameters."
echo -e "Usage:"
echo -e " FindReplace 'filepat' findstring replacestring\n"
exit 1
fi
echo $1 $2 $3
for i in `find . -name "$1" -exec grep -l "$2" {} \;`
do
#echo "iiiiiiiiiiiiiiiiiiiiiiiiiii"$i
mv "$i" "$i.sedsave"
sed "s^$2^$3^g" "$i.sedsave" > "$i"
echo "Replacing $2 with $3 in $i"
rm "$i.sedsave"
done
how will i put escaping into it so that \\ is not removed
10 More Discussions You Might Find Interesting
1. News, Links, Events and Announcements
See this article:
http://story.news.yahoo.com/news?tmpl=story&cid=74&ncid=738&e=9&u=/cmp/20030809/tc_cmp/13000487 (3 Replies)
Discussion started by: Neo
3 Replies
2. Shell Programming and Scripting
hi
sed -e '/<group>/!s/group\(.*\)/group\: files compat/' /etc/nsswitch.conf
returns
group: files compat
netgroup: files compat
How to prevent changing netgroup entry??
thank you (1 Reply)
Discussion started by: melanie_pfefer
1 Replies
3. Shell Programming and Scripting
Okay, title is kind of confusion, but basically, I have a lot of scripts on a server that I need to replace a ps command, however, the new ps command I'm trying to replace the current one with pipes to sed at one point. So now I am attempting to create another script that replaces that line.
... (1 Reply)
Discussion started by: cbo0485
1 Replies
4. Shell Programming and Scripting
Hi All,
The below code successfully tails the logfile.log file and colors every word "ERROR" in RED, thanks to the Perl statement below.
However, would anyone know how to append 1 additional search/replace to the Perl statement below, to color the word "SUCCESS" in GREEN (using ANSI \e
... (3 Replies)
Discussion started by: chatguy
3 Replies
5. HP-UX
Which command replaces "ntsysv" of Linux in HP-UX?
Which command can I use in HP-UX to see all running processes ?
:( (3 Replies)
Discussion started by: manalisharmabe
3 Replies
6. Shell Programming and Scripting
Helo,
I have a kml file with 39.000 lines.
Need search text and add a sequential number before text.
Original file
<Placemark>
<name>POI</name>
<styleUrl>#waypoint</styleUrl>
<Point>
<coordinates>2.104510,41.341900</coordinates>
</Point>
... (3 Replies)
Discussion started by: saba01
3 Replies
7. Red Hat
I've got an issue with a VMWare server running RHEL 6.3 that has dual E1000 NICs. I have configured the cards as I would normally do in /etc/sysconfig/network-scripts as ifcfg-eth0 and ifcfg-eth1. I can execute ifup eth0 and bring the interface up quite happily, however when I execute ifup eth1 it... (2 Replies)
Discussion started by: phaedrus
2 Replies
8. Shell Programming and Scripting
I need to replace the value of notifications_enabled to 0 if the value already set to 1 and vice versa(not the other values and spaces remain same after the value changed). I tried the below program for that. Can any one help me out.
file:test.cfg
define host {
hostgroups ... (2 Replies)
Discussion started by: praveen265
2 Replies
9. Shell Programming and Scripting
Hi,
I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :-
./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies
10. UNIX for Dummies Questions & Answers
Hi All,
I'm relatively new to Unix scripting and am trying to get my head around piping.
I'm trying to take a header record from one file and prepend it to another file. I've done this by creating several temp files but i'm wondering if there is a cleaner way to do this.
I'm thinking... (10 Replies)
Discussion started by: BigCroyd
10 Replies
httppower(8) powerman httppower(8)
NAME
httppower - communicate with HTTP based power distribution units
SYNOPSIS
httppower [--url URL]
DESCRIPTION
httppower is a helper program for powerman which enables it to communicate with HTTP based power distribution units. It is run interac-
tively by the powerman daemon.
OPTIONS
-u, --url URL
Set the base URL.
INTERACTIVE COMMANDS
The following commands are accepted at the httppower> prompt:
auth user:pass
Authenticate to the base URL with specified user and password, using ``basic'' HTTP authentication which sends the user and password
over the network in plain text.
seturl URL
Set the base URL. Overrides the command line option.
get [URL-suffix]
Send an HTTP GET to the base URL with the optional URL-suffix appended.
post [URL-suffix] key=val[&key=val]...
Send an HTTP POST to the base URL with the optional URL-suffix appended, and key-value pairs as argument.
FILES
/usr/sbin/httppower
/etc/powerman/powerman.conf
ORIGIN
PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms
of the GNU GPL.
SEE ALSO
powerman(1), powermand(8), httppower(8), plmpower(8), vpcd(8), powerman.conf(5), powerman.dev(5), powerman-devices(7).
http://sourceforge.net/projects/powerman
powerman-2.3.5 2009-02-09 httppower(8)