10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
UNIX gurus
I need your help with the following (The server is an AIX box).
I have a text file with the following information:
********************************************************
SOME LINES
case
:WORD1
SOME LINES
:WORD2
SOME LINES
:WORD3
SOME LINES
esac
SOME LINES... (7 Replies)
Discussion started by: curiousmal
7 Replies
2. Shell Programming and Scripting
Hello, I recently sought help on another thread about how to prefix 2 words in a file with 'pack/'. This is the command:
sed --in-place 's/"\(libraries\|objects\)"/"pack\/\1"/g'
Background: I have a .json file with the word 'libraries' and 'objects' in it. However, 'libraries' occurs twice;... (6 Replies)
Discussion started by: AJ Ruckman
6 Replies
3. Shell Programming and Scripting
hi I am trying to use SED to replace the line matching a pattern using the command
sed 'pattern c\
new line
' <file1 >file 2
I got two questions
1. how do I insert a blank space at the beginning of new line?
2. how do I use this command to execute multiple command using the -e... (5 Replies)
Discussion started by: piynik
5 Replies
4. UNIX for Advanced & Expert Users
Hi
I want to use sed to insert one space after the 10'th character in every line.
The lines are on this format:
2012-01-1012:30:55|7323456|65432
2011-02-0313:11:06|1223|3456
......
......
Does anyone know sed well enough to acomplish this?
If there is any other way around this... (7 Replies)
Discussion started by: ic12
7 Replies
5. Shell Programming and Scripting
My source is on each line
98.194.245.255 - - "GET /disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=&drc=&mo=&sid=&lang=EN&loc=JPN HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR... (5 Replies)
Discussion started by: elamurugu
5 Replies
6. Shell Programming and Scripting
I have a website. I have a directory within it with over a hundred .html files. I need to change a date within every file. I don't have an easy way to find/replace.
I need to change 10/31 to 11/30 on every single page at once. I tried the command below but it didn't work. Obviously I don't know... (3 Replies)
Discussion started by: ijustsawmars
3 Replies
7. Shell Programming and Scripting
Hi,
I want to add a character "#" in this few lines with sed command
Initial:
### CACCIA: DEBUT ###
if $(grep -wqi "$2" /etc/passwd); then
chuser -R files registry=files $2
fi
### CACCIA: FIN ###
Result with sed command:
### CACCIA: DEBUT ###
#if $(grep -wqi "$2"... (4 Replies)
Discussion started by: khalidou13
4 Replies
8. Shell Programming and Scripting
I am looking to change a data file into a javascript string and this is the code that I am using:
sed -i '' -e 's/^/str += "/' -e 's/$/";/' file.xml
The first part
-e 's/^/str += "/'
works as intended, but the second part
-e 's/$/";/'
adds an additional newline to my file, so that instead of... (3 Replies)
Discussion started by: figaro
3 Replies
9. Shell Programming and Scripting
how to change the name of the file which is having space in between
i have a file name called.
san con.cfg ( since it cannot be opened )
i want to rename it to
san_con.cfg
i tried to cat and mv .. but not working (3 Replies)
Discussion started by: mail2sant
3 Replies
10. Shell Programming and Scripting
Hi
I am a beginner to sed command, here I have a question about using sed to add a few characters into a token of a string.
For example, I have a file,
sqw:qqq:123124:uiqe
dfd:ccc:12390:dfjis
cde:aaa:21311:dfjsid
and, I want the output to be,
sqw:qqq:123124:uiqe... (4 Replies)
Discussion started by: Julius
4 Replies