hii,
i need a unix command which replaces all occurrences of a substring within a string with another substring.
My solution:
string="plalstalplal"
sub1="al"
sub2="mlkl"
echo sed 's/$s2/$s3/g' < s1 > p
i want to know how to read the variables s2 and s3..
thaks a lot
bye (1 Reply)
I have three files that the string inside it I want to replace
so my code will be
#!/bin/bash
read -p "please input the old string:" string1
read -p "please input the new string:" string2
sed -i "s/string1/string2/g" *.c
but the problem is.. the string that I want to replace can't be... (2 Replies)
Hi there,
I'd like to replace STRING_ZERO in FILE_ZERO.txt with the value of VALUEi-th by using something like that:
VALUE1=1000
VALUE2=2000
VALUE3=3000
for((i=1;i<=3;i++));
do
sed "s/STRING_ZERO/$VALUE'$i'/" FILE_ZERO.txt >> FILE_NEW.txt;
done
but it doesn't work...
Any help... (9 Replies)
Hi,
I have a line something like this
sys,systematic,system
I want to replace only the word system with HI
I used sed for this as below
echo sys,systematic,system | sed 's/system/HI/'
but I got output as
sys,HIatic,system
I wanted output as
sys,systematic,HI
Please tell me... (9 Replies)
I have following set of dirs:
/dir1/dir2/subdir1
file1
file2
/dir1/dir3/subdir1
file4
file5
/dir1/dir4/subdir1
file6
file7
All of these files have a common string in them say "STRING1", How can I... (3 Replies)
I'm trying to replace a string "99999999'" with the blank where ever is there in the file. Could you please help in unix scripting.
Thank You. (6 Replies)
Help!
I'm trying this command but keep getting illegal syntax etc.
awk '{ sub(/00012345/,"000123456"); print}' >newfile
I don't understand. It works on one unix machine but not another! (4 Replies)
Dear all,
I have a file like below. I want to replace all the '.' in the 3rd column with 'NA'. I don't know how to do that. Anyone has an iead? Thanks a lot!
8 70003200 21.6206
9 70005700 17.5064
10 70002200 .
11 70005100 19.1001
17 70008000 16.1970
32 70012400 26.3465
33... (9 Replies)
Hi All,
I have below requirement:
I need to read each line in file.txt and replace string starting from position 9 to 24 {111111111111111,222222222222222,333333333333333} by common string "444444444444444" and save file.
File.txt:
03000003111111111111111 ... (3 Replies)
Hi All,
I have a many folders in a directory under which there are many subdirectories containing text files containing the word "shyam" in them.I want all the files in all the directories containing "shyam to "ram" ??
sed "s/shyam/ram/g" does it ??But anyone can help me with the script ??
... (3 Replies)
Discussion started by: Pradeep_1990
3 Replies
LEARN ABOUT CENTOS
abrt-dump-oops
ABRT-DUMP-OOPS(1) ABRT Manual ABRT-DUMP-OOPS(1)NAME
abrt-dump-oops - Extract oops from FILE (or standard input)
SYNOPSIS
abrt-dump-oops [-vusoxtm] [-d DIR]/[-D] [FILE]
DESCRIPTION
This tool creates problem directory from, updates problem directory with or prints oops extracted from FILE or standard input.
OPTIONS -v, --verbose
Be more verbose. Can be given multiple times.
-s
Log to syslog
-o
Print found oopses on standard output
-d DIR
Create new problem directory in DIR for every oops found
-D
Same as -d DumpLocation, DumpLocation is specified in abrt.conf
-u PROBLEM
Save the extracted information in PROBLEM directory
-x
Make the problem directory world readable. Usable only with -d/-D
-t
Throttle problem directory creation to 1 per second
-m
Print search string(s) for abrt-watch-log to stdout and exit
SEE ALSO abrt-watch-log(1), abrt.conf(5)AUTHORS
o ABRT team
abrt 2.1.11 06/18/2014 ABRT-DUMP-OOPS(1)