Search Results

Search: Posts Made By: brianjb
Forum: OS X (Apple) 08-27-2014
4,754
Posted By Corona688
It means what it says, it had trouble reading one...
It means what it says, it had trouble reading one (or more) of the input files, as one might exepct of a dying hard drive. But it didn't actually quit, it waited until it was done to quit with error.
Forum: OS X (Apple) 08-27-2014
4,754
Posted By Corona688
tar shouldn't die halfway, just continue and...
tar shouldn't die halfway, just continue and print warnings. GNU tar, anyway. Good luck.
Forum: OS X (Apple) 08-26-2014
4,754
Posted By Corona688
If you keep poking at your drive while it is...
If you keep poking at your drive while it is "making funny noises" you are going to lose it completely. Make a raw dd copy if you have to, but get the contents off!

Either that, or stop poking at...
1,862
Posted By bartus11
First I would try to modify your "crontab -l"...
First I would try to modify your "crontab -l" command so that information is easy to extract from this bit messy file, adding hostname for later convenience in parsing. Try running this instead of...
10,075
Posted By bartus11
I'd say go with learning Perl if you want to keep...
I'd say go with learning Perl if you want to keep being competitive in the job market. Perl scripting is highly desirable skill for SysAdmins.
10,075
Posted By joeyg
This is not an either-or question
I would recommend that you begin learning perl. While at it, probably become better at sed and awk. There is no best, merely different tools to be used at different times.

Can you bang a nail in...
10,075
Posted By Corona688
The order I learned things: perl, shell,...
The order I learned things:

perl, shell, awk.

The order I wish I'd learned things:

shell, awk, perl.

They all have their uses... If you find yourself writing system() over and over, it...
1,774
Posted By Scrutinizer
Hi, try: awk 'NR==1{h=$0} $1~/\.$/{print h RS...
Hi, try:
awk 'NR==1{h=$0} $1~/\.$/{print h RS $0 RS}'

or perhaps this is more like what you are after:
awk 'NR==1{h=$0} sub(/\.$/,x,$1){print h RS $0 RS}' OFS=,
3,006
Posted By Scrutinizer
You left out OFS=, ORS= at the end of your...
You left out
OFS=, ORS=
at the end of your awk..

/usr/xpg4/bin/awk 'p!=$1{if(p)print RS; print p=$1,$2}{for(i=5;i<=NF;i++)$4=$4 FS $i; print OFS $3 "=\"" $4 "\""} END{print RS}' OFS=, ORS=...
3,006
Posted By Corona688
By the by, that's a useless use of cat...
By the by, that's a useless use of cat (http://partmaps.org/era/unix/award.html). You almost never need cat to read a file, programs are perfectly capable of reading files themselves, and even if...
2,784
Posted By Corona688
printf is a function found in many different...
printf is a function found in many different programming language for convenient formatting of numbers and strings. Its first argument describes how to format all the arguments afterwards when...
2,784
Posted By Scrutinizer
Hi, try END {printf "%d\n",sum/6} or END {printf...
Hi, try END {printf "%d\n",sum/6} or END {printf "%.2f\n",sum/6}
2,346
Posted By neutronscott
pidfile=/var/tmp/stats.pid # exit if another...
pidfile=/var/tmp/stats.pid

# exit if another is running
[ -e "$pidfile" ] && exit

# create pid file
echo $$ >"$pidfile"

# delete pid file on exit (may have to do this definitely depending...
3,006
Posted By Chubler_XL
Might need something like this for the *Name...
Might need something like this for the *Name fields:

awk 'p!=$1{print (p?RS:"")(p=$1),$2;} {for(i=4;i<=NF;i++)printf(i>4?" ":OFS $3 "=\"") $i; print "\"" } END{if(p)print RS}' OFS=, ORS= infile
3,006
Posted By Scrutinizer
Hi, see if this works: awk 'p!=$1{if(p)print...
Hi, see if this works:
awk 'p!=$1{if(p)print RS; print p=$1,$2}{print OFS $3 "=\"" $4 "\""} END{print RS}' OFS=, ORS= infile
Showing results 1 to 15 of 15

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