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
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
3. Shell Programming and Scripting
HI ,
I can't find a solution to the following:
In a simple menu script I want to capture the input from the user with "read" and use it as a value in a variable Rempages="some_value" which is in a different script file.
So I have to perform a search and replace for this variable and only... (4 Replies)
Discussion started by: svetoslav_sj
4 Replies
4. Shell Programming and Scripting
Hi.
I would like to have experts help on below action.
I have text files in which page nubmers exists in form like
PAGE : 1
PAGE : 2
PAGE : 3 and so on there is other text too. I would like to know is it possible to check the last occurance of Page... (6 Replies)
Discussion started by: lodhi1978
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. UNIX for Dummies Questions & Answers
I'm trying to replace text in a file with text from a variable
I have the following in my script, but its not working:
#!/bin/ksh
echo "Enter the path to load scripts"
read x
echo "updating the templates"
sed "s/CHANGE_ME_TO_LOAD_PATH/"$x"/g" LoadFiles.sh > LoadFiles2.sh
I thought... (1 Reply)
Discussion started by: orahi001
1 Replies
7. Shell Programming and Scripting
Is there an easy way of doing this
cat file1
jkasjhjgfg LTRIM(RTRIM(aa_bb_cde))
aragsfdg LTRIM(RTRIM(aa_bb_cde)) aregfafdgfg
sdgsfdagdfg gadfg
eafgsadgsa
asdgsfdgag LTRIM(RTRIM(aa_bb_cde)) rfghsdfhd
I want to replace each occurence of LTRIM(RTRIM($x)) with
LENGTH(LTRIM(RTRIM($x)))=0... (4 Replies)
Discussion started by: alfredo123
4 Replies
8. UNIX for Dummies Questions & Answers
Dear friends please help,
I have a large data file with few hundred lines. A small example is shown below:
datafile is a file with few hundred lines with the third column has many different character stings:
test 100 abc
test 134 bcd
test 356 cdf
test 831 dfg
test 720 fgh
I need to... (6 Replies)
Discussion started by: bobo
6 Replies
9. UNIX for Dummies Questions & Answers
test 100 abc
test 134 bcd
test 356 cdf
test 831 dfg
test 720 fgh
Please advise how can I replace the abc, bcd....with ABC, BCD.... (1 Reply)
Discussion started by: bobo
1 Replies
10. Shell Programming and Scripting
I have a variable whose value is
I="user1:x:1100:1200:ID for user1:/home/user1:/bin/ssh-dummy-shell"
I want to replace the last part '/bin/ssh-dummy-shell' with '/bin/true'
I tried using sed but it garbled
sed 's/\/bin\/ssh-dummy-shell/\/bin\/true' $I
Thanks for the help (5 Replies)
Discussion started by: aajmani
5 Replies