10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello Team,
Any help would be much appreciated for the below scenario:
I have a sed command below where I am trying to replace the contents of 'old_pkey' variable with 'new_pkey' variable in a Soap request file (delete_request.txt). This works fine for regular string values, but this new_pkey... (8 Replies)
Discussion started by: ChicagoBlues
8 Replies
2. Shell Programming and Scripting
I have an input file which is similar to what I have shown below.
Pattern : Data followed by two blank lines followed by data again followed by two blank lines followed by data again etc..
The first three lines after every blank line combination(2 blank lines between data) should be... (2 Replies)
Discussion started by: bikerboy
2 Replies
3. Shell Programming and Scripting
Hi,
I would like to delete lines in /etc/hosts on few workstations, basically I want to delete all the lines for a list of machines like this :
for HOST in $(cat stations.lst |uniq)
do
# echo -n "$HOST"
if ping -c 1 $HOST > /dev/null 2>&1
then
HOSTNAME_val=`rsh $HOST "sed... (3 Replies)
Discussion started by: albator1932
3 Replies
4. Shell Programming and Scripting
Hi, I'm writing a ksh script and trying to use an awk / sed / or perl one-liner to remove the last 4 characters of a line in a file if it begins with a period.
Here is the contents of the file... the column in which I want to remove the last 4 characters is the last column. ($6 in awk). I've... (10 Replies)
Discussion started by: right_coaster
10 Replies
5. Shell Programming and Scripting
I have a binary (hex) file I need to parse to get some data which are encoded this way:
.* b4 . . . 01 12 .* af .* 83 L1 x1 x2 xL 84 L2 y1 y2 yL
By another words there is a stream of hexadecimal bytes (in my example separated by space for better readability). I need to get value stored in... (3 Replies)
Discussion started by: sameucho
3 Replies
6. Shell Programming and Scripting
I'm looking for SED equivalent for grep -w -f. All I want is to search a list of patterns from a file. Also If the pattern doesn't match I do not want "null returned", rather I would prefer some text as place holder say "BLANK LINE" as I intend to process the output file based on line number.
... (1 Reply)
Discussion started by: novice_man
1 Replies
7. Shell Programming and Scripting
I'm very new to awk and sed and I've been struggling with this for a while.
I'm trying to search a file for a string with special characters and this string is a command line argument to a simple script.
./myscript "searchpattern" file
#!/bin/sh
awk "/$1/" $2 > dupelistfilter.txt
sed... (6 Replies)
Discussion started by: cue
6 Replies
8. Shell Programming and Scripting
Hi all,
I have the following lines
<b>A gtwrhwrthwr text hghthwrhtwrtw </b><font color='#06C'>; text text (text)
<b>B gtwrhwrthwr text hghthwrhtwrtw </b><font color='#06C'>; text text (text)
<b>J gtwrhwrthwr text hghthwrhtwrtw </b><font color='#06C'>; text text (text)
and I would like to... (5 Replies)
Discussion started by: stinkefisch
5 Replies
9. Shell Programming and Scripting
Hi All,
Can someone please help me write a script for the following requirement in awk, grep, sed or perl.
Buuuu xxx bbb
Kmmmm rrr ssss uuuu
Kwwww zzzz ccc
Roooowwww eeee
Bxxxx jjjj dddd
Kuuuu eeeee nnnn
Rpppp cccc vvvv cccc
Rhhhhhhyyyy tttt
Lhhhh rrrrrssssss
Bffff mmmm iiiii
Ktttt... (5 Replies)
Discussion started by: kumarn
5 Replies
10. Shell Programming and Scripting
i have this script that searches for a pattern.
However it fails if the pattern includes some
special characters. So far, it fails with the
following strings:
1. -Cr
2. $Mj
3. H'412
would a sed or awk be more effective?
i don't want the users to put the (\)
during the search (they... (5 Replies)
Discussion started by: apalex
5 Replies