10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All, Hoping someone can help....
I am trying to work out how I can ammend a log file to remove variable strings in order to remove confidential information which I cant pass on.
As an example I have used phone numbers. A large log file contains multiple lines containing something like the... (6 Replies)
Discussion started by: mutley2202
6 Replies
2. Shell Programming and Scripting
Hello everyone,
In one of my shell script I am doing sed/replace using a variable to find a string in a file & replace it with another string in same file.
The challenge which I am facing is that, the variable which I am using with "sed" is having one of character as "/"
Here is below how... (4 Replies)
Discussion started by: gr8_usk
4 Replies
3. Shell Programming and Scripting
Hi,
I have a ksh script where I am trying to mask the password in the log files.
$loc - is my directory
$PGUIDE_DB_USER_PSW - is a variable that holds the password I am looking for
find $loc/logs -type f -exec sed -i "s/$PGUIDE_DB_USER_PSW/*****/"g {} \;
I get an error:
... (2 Replies)
Discussion started by: amitlib
2 Replies
4. Red Hat
Hi all,
Hereby wish to have your advise for below:
Main concept is
I intend to get current directory of my script file.
This script file will be copied to /etc/init.d.
A string in this copy will be replaced with current directory value.
Below is original script file:
... (6 Replies)
Discussion started by: cielle
6 Replies
5. Shell Programming and Scripting
Hi,
I'm making a script that automaticaly set file size and path in xml file.
I tried with :
sed -i 's/BOOTPATH/TEST/g' file.xml
it works fine
but if I use a viriable :
sed -i 's/BOOTPATH/$bootpathf/g' file.xml
with this one, no change are made.
I don't understand why. If a make a ... (13 Replies)
Discussion started by: Toug
13 Replies
6. Shell Programming and Scripting
Hi,
I hope someone can help me out with the following:
I have a file with the following lines in it:
something /path/dir/my_-_file.01.ext sometext sometext
somethingelse /path/dir/my_-_file.02.ext sometext
something /path/dir/my_-_file.03.ext sometext some other text
And i want to... (3 Replies)
Discussion started by: thyssimonis
3 Replies
7. Shell Programming and Scripting
Hello,
I have this command and it works fine.
My question is that how can we replace the N by a variable, to print for instance a big number of lines. It means if I want 100 lines after an expression, to not put "N" 100 times in the sed.
Code:
$ sed -n '/aaa/{n;N;N;s///g;s/;/; /g;p;}'... (2 Replies)
Discussion started by: rany1
2 Replies
8. Shell Programming and Scripting
Please Help... I am trying to manipulte the following line
Before :
<user:Account_Password>002786</user:Account_Password>
the password is the "variable", i need to delete / omit the password in the file, (it occurs several thousand times)
so the tag line looks like
After:... (4 Replies)
Discussion started by: jackn7
4 Replies
9. Shell Programming and Scripting
Hello everyone,
I need to replace a pattern with "value of a variable" using sed but no luck.
i tried the below
ABC=STR2
sed 's/STR1/$ABC/g' <file>
(also tried \ , $ and " in combination but failed)
Appreciate any help.
Thanks
Prvn (2 Replies)
Discussion started by: prvnrk
2 Replies
10. Shell Programming and Scripting
Is there a way that I can make the following work with using variables?
perl -pi -e 's#blah#hrm#ig' replacetext
but like this
var=blah
perl -pi -e 's#$var#hrm#ig' replacetext (3 Replies)
Discussion started by: doublejz
3 Replies