Search Results

Search: Posts Made By: gc_sw
6,733
Posted By MadeInGermany
And if you run the /var/tmp/gcsw/script.sh on the...
And if you run the /var/tmp/gcsw/script.sh on the command line?

Ensure it is executable,
and put a first line #!/bin/bash
to ensure it is the correct shell (your commands require bash or ksh or...
1,427
Posted By Don Cragun
Next time, please save us all a lot of time and...
Next time, please save us all a lot of time and aggravation by telling us what OS and shell you're using and showing us sample input and output that matches the data you want to process.

A...
28,158
Posted By radoulov
Another one: du -hs * | sed ...
Another one:

du -hs * |
sed 's/^\([0-9.]*\)\([KMG]*\)/\2 \1\2/
s/^K/1/;s/^M/2/;s/^G/3/' |
sort -k1 -k2n |
cut -c3- |
tail -10
5,291
Posted By radoulov
You mean prepend :) printf '%s -> %s\n' "$(date...
You mean prepend :)
printf '%s -> %s\n' "$(date '+%Y-%m-%d %H:%M')" "$(/var/tmp/gcsw -ne | fgrep 'State:2' | wc)"
Forum: Solaris 12-15-2006
15,532
Posted By System Shock
Right after loghost. Use a tab to spce it ...
Right after loghost. Use a tab to spce it


192.168.1.10 loghost mailhost
Forum: Solaris 09-05-2011
30,530
Posted By solaris_user
enter in terminal as root svcadm disable...
enter in terminal as root

svcadm disable svc:/network/sendmail-client:default
8,041
Posted By cfajohnson
_key() { local kp ESC=$'\e' _KEY= ...
_key()
{
local kp
ESC=$'\e'
_KEY=
read -d '' -sn1 _KEY
case $_KEY in
"$ESC")
while read -d '' -sn1 -t1 kp
do
_KEY=$_KEY$kp
case $kp in
...
4,685
Posted By pravin27
Hi, Try this, awk -F"~"...
Hi,
Try this,


awk -F"~" 'NR==FNR{a[$1]++;b[$2]++;next} {split($0,c,"|");if(a[c[1]]){printf $0"~";getline tmp < "to_file"; split(tmp,d,"|");if(b[d[1]]){print tmp}}}' key_file from_file
2,531
Posted By Franklin52
Try this: awk -F, '$1{$4="DTP"; $6="DSS"}1'...
Try this:
awk -F, '$1{$4="DTP"; $6="DSS"}1' OFS=\, file
2,531
Posted By pravin27
Try this, sed 's/,,/,DTP,/ ;s/,,/,DSS,/' ...
Try this,

sed 's/,,/,DTP,/ ;s/,,/,DSS,/' inputfile
2,285
Posted By anurag.singh
OR using sed: sed -n 's/^To: <\(.*\)>/\1/p'...
OR using sed:

sed -n 's/^To: <\(.*\)>/\1/p' email.txt
sed -n 's/^Subject: \(.*\)/\1/p' email.txt
2,285
Posted By ctsgnb
nawk '(/^To/||/^Subject/){sub(".*"$2,$2)}1'...
nawk '(/^To/||/^Subject/){sub(".*"$2,$2)}1' infile
sed 's/^To: //;s/^Subject: //;s/[<>]//g' infile
2,285
Posted By Scrutinizer
awk '{gsub(/[<>]/,x)}sub(/^(To|Subject): /,x)'...
awk '{gsub(/[<>]/,x)}sub(/^(To|Subject): /,x)' infile
5,353
Posted By bartus11
This will change the value from DEBUF to INFO for...
This will change the value from DEBUF to INFO for webservice "WEBSERVICENAME"perl -i -lp0e 's/(?<=name="WEBSERVICENAME")(.*?)DEBUG/$1INFO/s' Log4j.xml
2,688
Posted By michaelrozar17
Thanks radoulov. I have two question wrt the...
Thanks radoulov. I have two question wrt the field separator. If the field separator is ^A in the file, why do we have 2 backslashes, i thought one would be enough.If 2 backslashes it mean literally...
2,688
Posted By radoulov
You need one more backslash with the old command...
You need one more backslash with the old command substitution command:

export a=`awk -F'\\\^A' '{ print $1 }' file1.sh`

But, of course, you should use the new one $( ... ), if your shell...
909
Posted By anurag.singh
May be like below: Create an empty file when...
May be like below:
Create an empty file when script is schedule by 'at' and check for this file existance when 1st argument is 'start'

if [ $1 = "start" ]; then
if [ -f script_scheduled ];...
1,377
Posted By anurag.singh
awk 'NR==FNR{a=a?a"get . "$0";":"get ....
awk 'NR==FNR{a=a?a"get . "$0";":"get . "$0";";next;}{print "i ./shell "$0" "c a "l-"c}' c="'" Code ip.txt
2,243
Posted By m.d.ludwig
PLease be careful with [$1$2] and [$3$2]...
PLease be careful with [$1$2] and [$3$2] constructs, for data like
192.168.1.1 21
192.168.1.12 1will munge together. Awk "supports" multidimensional arrays -- it interpolates the value of...
2,243
Posted By Scrutinizer
awk 'NR==FNR{A[$3,$2]=$4;next}...
awk 'NR==FNR{A[$3,$2]=$4;next} NF>2{for(i=3;i<=NF;i+=3)$(i+2)=A[$i,$(i+1)];B[$1,$2]=$0;next} B[$1,$2]{print B[$1,$2]}' OFS='\t' ip-port.txt lookup.txt rollbackip.txt
2,243
Posted By rdcwayx
That's the best.:b:
That's the best.:b:
2,449
Posted By anurag.singh
awk '/cell/ {n=split($3,a,"[-/]");...
awk '/cell/ {n=split($3,a,"[-/]"); for(i=2;i<=n;i++) if($(i+2) != "111111") print a[1],i-1}' file1.txt
If on Solarish, Just replace awk with nawk.
2,119
Posted By anurag.singh
awk...
awk 'NR==FNR{a[$1_$2]=$0;next;}{if(NF==1){if(substr($1,length($1)-3)=="Down") b=1; else b=0; } if(b==1 && a[$1_$2]) $0=a[$1_$2]; print; }' down.txt file.txt
2,449
Posted By anurag.singh
awk '/cell[0-9]*-1/...
awk '/cell[0-9]*-1/ {idx=index($3,"-");cell=substr($3,0,idx-1);n=split(substr($3,idx+1),a,"/"); for(i=1;i<=n;i++) if($(i+3) != "111111") print cell,a[i]}' file1.txt
3,161
Posted By anurag.singh
awk -F= '/description=..*/ || /instances=/...
awk -F= '/description=..*/ || /instances=/ {if(substr($0,1,11)=="description"){a=$2;getline;b=$2;print a" ["b"]";}}' rtprod2.scp
Showing results 1 to 25 of 108

 
All times are GMT -4. The time now is 07:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy