3
votes
2answers
75 views

how to grep complex hierarcy?

I have a file as:- start apple 1 a 2 b 3 c start orange 4 a 5 b start mango 1 a start a/b/c 5 z end 4 b end 6 c end start banana 3 c end 4 d 5 e end I want the output as :- 1 apple/a 2 apple/b 3 ...
2
votes
2answers
142 views

linux & solaris - separate netmask IP's from ordinary IP's

I have file with IP address and netmask IP's my target is to cut the netmask IP's from the file_with_IPs.txt and paste them to another file as file_with_only_netmask_ips.txt remark - netmask IP can ...
-3
votes
4answers
476 views

perl one liner + how to replace any last IP address octets

How to replace any last IP address octets (four octet ) to 0 remark: Implementation should be by Perl one linear on linux machines for example 192.9.200.124 will replaced to 192.9.200.0 ...
1
vote
4answers
3k views

sed/awk/perl - delete spaces between two strings/words + solaris 10

please advice how to delete the spaces between "=" to the value/string ( after the "=" character) , should be implemented by awk or sed or perl command and command must to fit for solaris OS , ( ...
9
votes
2answers
1k views

Using sed to color the output from a command on solaris

I have a ksh script that must work on both linux and solaris. I'm trying to color the output of specific commands. It works on linux (specifically RHEL6), but not on solaris (SunOS 5.10). Command ...
3
votes
2answers
5k views

Sed: Replace N first occurrences of a character

I am looking to replace the 5 first occurences of the whitespace character per line inside a sed script. Here's what I have so far sed -e "s/ /;/" -e "s/ /;/" -e "s/ /;/" -e "s/ /;/" -e "s/ /;/" ...