07-15-2008
Radoulov.
In like flyn. the bottom code you supplied also worked awesome. thank you for your help. Can you take a min to explain how it works? I understand the basics of sed
's = substitute
first set /XXX/ is the regexp i want to identify
second sed /XXX/ is what I want it changed to and
g' = do it globally
but i can't read whats going on.
oh and the reason I was having a problem yesterday is because when I put your code in a file so that I could pipe my file through it I didn't take the last single ' off the back of the g.
Thank you
Last edited by mitch; 07-15-2008 at 10:17 AM..
Reason: add info
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have the following data file.
zz=aa azxc-1234 aa=aa
zz=bb azxc-1234 bb=bb
zz=cc azxc-1234 cc=cc
zz=dd azxc-2345 dd=dd
zz=ee azxc-2345 ee=ee
zz=ff azxc-3456 ff=ff
zz=gg azxc-4567 gg=gg
zz=hh azxc-4567 hh=hh
zz=ii azxc-4567 ii=ii
I want to make 2nd field pattern matching multiple lines... (13 Replies)
Discussion started by: VTAWKVT
13 Replies
2. Shell Programming and Scripting
Hi,
I want to make sed write a part of fileA (first 7 lines) to file1 and the rest of fileA to file2 in a single call and single line in sed. If I do the following:
sed '1,7w file1; 8,$w file2' fileA
I get only one file named file1 plus all the characters following file1. If I try to use curly... (1 Reply)
Discussion started by: varelg
1 Replies
3. Shell Programming and Scripting
Would appear to me to be a farily simple question but having search all the threads I can't find the answer .. I just want sed to output the single line in a file that contains two string anywhere on the line..
e.g. currently using this command
sed -n -e'/str1/p' -e '/str2/p' < file
and... (3 Replies)
Discussion started by: flopster
3 Replies
4. Shell Programming and Scripting
Hi all,
My search karate must be weak because I'm about certain something very like this has been asked and answered here many times. I'll give you the exact scenario I've wasted a few hours of my Saturday on: :wall:
I'm trying to read through a very large number (~200) of router and... (28 Replies)
Discussion started by: svermill
28 Replies
5. Shell Programming and Scripting
Hello
I did do a search and the past threads doesn't really solve my issue. (using various awk commands)
I need to combine the output from java -version into 1 line, but I am having difficulties.
When you exec java -version, you get:
java version "1.5.0_06"
Java(TM) 2 Runtime... (5 Replies)
Discussion started by: flagman5
5 Replies
6. Shell Programming and Scripting
Hi,
My Oracle query is returing below o/p
----------------------------------------------------------
Ins trnas value
a lkp1 x
a lkp1 y
b lkp1 a
b lkp2 x
b lkp2 y ... (7 Replies)
Discussion started by: gvk25
7 Replies
7. Shell Programming and Scripting
Hi all,
I have a single line output like below
echo $ips
10.26.208.28 10.26.208.26 10.26.208.27
want to convert above single line output as below format. Pls advice how to do ?
10.26.208.28
10.26.208.26
10.26.208.27
Regards
Kannan (6 Replies)
Discussion started by: kamauv234
6 Replies
8. Shell Programming and Scripting
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies
9. Shell Programming and Scripting
I need to match two patterns in a log file and need to get the next line of the one of the pattern (out of two patterns) that is matched,
finally need to print these three values in a single line.
Sample Log:
2013/06/11 14:29:04 <0999> (725102) Processing batch 02_1231324
2013/06/11... (4 Replies)
Discussion started by: rpm120
4 Replies
10. UNIX for Beginners Questions & Answers
example of problem:
when I echo "$e" >> /home/cogiz/file.txt
result prints to file as:AA
BB
CC
I need it to save to file as this:AA BB CC
I know it's probably something really simple but any help would be greatly appreciated.
Thank You.
Cogiz (7 Replies)
Discussion started by: cogiz
7 Replies
LEARN ABOUT MOJAVE
list_devices
list_devices(1) list_devices(1)
NAME
list_devices - list allocatable devices
SYNOPSIS
list_devices [-s] [ -U uid] -l [device]
list_devices [-s] [ -U uid] -n [device]
list_devices [-s] [ -U uid] -u [device]
The list_devices utility lists the allocatable devices in the system according to specified qualifications.
The device and all device special files associated with the device are listed. The device argument is optional and, if it is not present,
all relevant devices are listed.
The following options are supported:
-l [device] Lists the pathname(s) of the device special files associated with the device that are allocatable to the current process.
If device is given, lists only the files associated with the specified device.
-n [device] Lists the pathname(s) of device special files associated with the device that are allocatable to the current process but
are not currently allocated. If device is given, lists only the files associated with that device.
-s Silent. Suppresses any diagnostic output.
-u [device] Lists the pathname(s) of device special files, associated with the device that are allocated to the owner of the current
process. If device is given, list only the files associated with that device.
-U uid Uses the user ID uid instead of the real user ID of the current process when performing the list_devices operation. Only a
user with the solaris.device.revoke authorization can use this option.
The following exit values are returned:
non--zero An error occurred.
/etc/security/device_allocate
/etc/security/device_maps
/etc/security/dev/*
/usr/security/lib/*
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
allocate(1), deallocate(1), bsmconv(1M), dminfo(1M), mkdevalloc(1M), mkdevmaps(1M), device_allocate(4), device_maps(4), attributes(5)
The functionality described in this man page is available only if the Basic Security Module (BSM) has been enabled. See bsmconv(1M) for
more information.
/etc/security/dev, mkdevalloc(1M), and mkdevmaps(1M) might not be supported in a future release of the Solaris Operating Environment.
28 Mar 2005 list_devices(1)