Search Results

Search: Posts Made By: linuxadmin
1,694
Posted By RudiC
Try also awk 'NR == FNR {T[$1]=$2;next} ...
Try also awk 'NR == FNR {T[$1]=$2;next}
$2 == T[$1] {delete T[$1]; next}
{printf "| %s=%s |",$1,$2;
if (T[$1]!="") printf "...
1,694
Posted By RavinderSingh13
Hello, Following may help you in same. ...
Hello,

Following may help you in same.


$ cat differ_2_files121111.ksh
a=`awk 'NR==FNR {a[$1];next} !($1 in a) {print $1}' check_file_comp2 check_file_comp1`
b=`awk 'NR==FNR {a[$1];next}...
4,540
Posted By rangarasan
awk
Please use code tag for code and data samples.

Try smth like this.


awk -v ip=$(hostname -i) '/InternetProtocol/{print;getline;ip=">"ip"<";sub(/>.*</,ip);}1' input_file


Cheers!!!
-R
10,099
Posted By Corona688
That would've been good to mention in the first...
That would've been good to mention in the first place, since it changes the picture a lot. Development can be a pain in a lot of otherwise-good distros.

I've heard good things about SuSe for...
1,559
Posted By Neo
In the shell scripts forum.....
In the shell scripts forum.....
4,873
Posted By ygemici
I could not look all of script but i can say...
I could not look all of script but i can say something as far as I look over.;)

RamInSystem=`echo \`dmidecode --type 17 | grep "Size" | grep "MB" |awk '{print $2}'\``
RamInSystem=`dmidecode...
4,873
Posted By Corona688
Some comments: 1) We often get the "linux...
Some comments:

1) We often get the "linux newbie memory freakout" here. A new user may see "56M free" and panic -- rebooting obsessively when free gets low, plugging bizzare and harmful values...
2,733
Posted By sk1418
does this work? run it under your src root. ...
does this work? run it under your src root.

grep -r -B2 -A3 "System.out.println" java|awk -F'-|:' '{if($1&&x!=$1){print $1;x=$1;} print $2}'
5,530
Posted By psshah
Yep. Check for: BSM Audit...
Yep.


Check for:

BSM Audit (http://www.sunwizard.net/html/PDFs/Solaris_C2_Auditing_with_BSM.pdf (http://www.sunwizard.net/html/PDFs/Solaris_C2_Auditing_with_BSM.pdf) )
ttywatcher...
2,814
Posted By gary_w
You could also collect your functions in a...
You could also collect your functions in a separate file, and use them in other scripts as well. Include them in your script like this:
. func_library.shThe dot command runs the func_library.sh...
2,814
Posted By cfajohnson
Define all your functions at the beginning of the...
Define all your functions at the beginning of the script. Then they may be called from wherever you like, in any order, including from another function.

a1()
{
echo "$FUNCNAME"
a3
}

a2()...
2,814
Posted By yazu
No: Functions...
No: Functions (http://tldp.org/LDP/abs/html/functions.html)
Forum: Open Source 08-19-2011
341,129
Posted By Corona688
If you install vim you get the "vimtutor"...
If you install vim you get the "vimtutor" command, I think.
3,335
Posted By yazu
This script should work: while read f; do ...
This script should work:
while read f; do
new=`echo "$f" | sed 's/MainDir/data/'`
d=`dirname "$new"`
mkdir -p "$d"
cp -v "$f" "$d"
done <INPUTFILE
18,420
Posted By zaxxon
Or without a split, just deleting .*-: awk...
Or without a split, just deleting .*-:

awk '/^INFO: Starting/ {sub(/\/1.1/,"",$4); a=$1 FS $2 FS $3 FS $4; sub(/.*-/,"",$NF); b=$NF; getline; sub(/,$/,"",$2); print $1,$2,a,b}' infile
18,420
Posted By zaxxon
The while loop will cycle through the lines of...
The while loop will cycle through the lines of the input file, where on each line is the name or IP-address of a single host to be inspected. So 10 lines will be 10 ssh connects, one to each host.
...
Forum: AIX 07-19-2011
15,195
Posted By Scott
There is no rc.local by default, in AIX (at least...
There is no rc.local by default, in AIX (at least not in 5.3!). If you want to add one, you'll need to let /etc/inittab know about it.

And what if you want to stop the program when the server...
3,589
Posted By Smiling Dragon
You've put single quotes round the 'sh...
You've put single quotes round the 'sh $thisScript' part, that prevents the variable ($thisScript) from being replaced with the contents. You be actually running "$thisScript" instead of the name of...
1,995
Posted By sk1418
basically, the command is NOT gonna print any...
basically, the command is NOT gonna print any file, that doesn't containing "
new DataBaseConnection" string. Can that be that the string in your java file as comment? so you think it should be the...
1,995
Posted By sk1418
does this work ? (not tested) find yourPath...
does this work ? (not tested)
find yourPath -name "*.java" |xargs awk '/try{/{t=1} /}catch/{t=0} (!t && $0~/new DataBaseConnection\(/){print FILENAME}'
11,476
Posted By Scrutinizer
Don't use -w if your string is part of a word....
Don't use -w if your string is part of a word. For example:
grep -E "[Ee]xception|closed:" infile
3,522
Posted By bartus11
Try: netstat -vatn | grep LISTEN | perl -alne...
Try: netstat -vatn | grep LISTEN | perl -alne '$F[3]=~/\d+$/;print $&'
2,802
Posted By Franklin52
echo "$string1"| awk -F"[()]" '{print $2,...
echo "$string1"| awk -F"[()]" '{print $2, $4}'
Forum: Tips and Tutorials 10-08-2006
297,031
Posted By ripat
Simple date and time calulation in BASH
The GNU date command in full of goodies but not when it comes to calculate a date or time difference. Here is what I came up with after looking to more than one solution.

Code should be self...
Showing results 1 to 24 of 24

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