Search Results

Search: Posts Made By: yazu
3,511
Posted By Corona688
I think that's a GNU extension not found on most...
I think that's a GNU extension not found on most non-linux systems...
2,393
Posted By itkamaraj
rsync -vrz --copy-links --stats --exclude="*"...
rsync -vrz --copy-links --stats --exclude="*" $SOURCE/* $DESTINATION
3,382
Posted By kurumi
$ ruby -ne 'puts $_.gsub(/\s+/,"/")' file $...
$ ruby -ne 'puts $_.gsub(/\s+/,"/")' file
$ ruby -ane 'puts $F.join("/")' file


---------- Post updated at 07:28 AM ---------- Previous update was at 07:27 AM ----------



that don't change...
13,651
Posted By Corona688
Nice-looking program, though I would note one...
Nice-looking program, though I would note one problem:
char BUF[NBUF+1];
BUF[NBUF+1] = '\0'; Replace NBUF with 4 and follow along:

char BUF[4+1];
buf[0]=0; // first element
buf[1]=1; // second...
119,435
Posted By alister
ksh93 does indeed have a built-in sleep. GNU...
ksh93 does indeed have a built-in sleep.

GNU sleep is not special in this regard. I regularly use *BSD and every BSD's sleep(1) supports fractions of a second.

Regards,
Alister
4,564
Posted By dude2cool
# cat /tmp/yourinputfile|sort|./uniq -w 1
# cat /tmp/yourinputfile|sort|./uniq -w 1
1,807
Posted By alister
Distilling until nothing but the essence remains:...
Distilling until nothing but the essence remains:
awk -F\| '!a[$1]++' INPUTFILE
;)

Regards,
Alister
3,177
Posted By itkamaraj
ls -l | grep "Mar 10" | while read line; do...
ls -l | grep "Mar 10" | while read line; do fileName=$(echo $line | awk '{print $NF}'); echo "rm $fileName"; done
3,971
Posted By itkamaraj
Yazu, solution is best try that.. let us...
Yazu, solution is best

try that.. let us know if you dont have perl
19,667
Posted By alister
You probably won't have to split anything...
You probably won't have to split anything manually. Many (if not most) sort implementations (GNU, *BSD, Solaris, HP-UX, to name a few) will do this for you automatically. They compare the size of...
1,629
Posted By vgersh99
either: function alert_stock { ...
either:

function alert_stock
{
qtyA=`cat stockDB.txt | cut -d: -f4`
if [ "$qtyA" -lt 3 ]; then

echo $qtyA

fi
}
the above performs the numerical comparison (unlike '<'...
19,667
Posted By radoulov
Consider the following: % cat infile ...
Consider the following:

% cat infile
adsf123
asdlfkjlasdfj
adsf123
asdfasdf12341234
asdfasdf12341234
asdlfkjlasdfj343
asdlfkjlasdfj56
adsf123
asdlfkjlasdfj
adsf123
asdfasdf12341234...
2,651
Posted By pravin27
perl -nle '$,=",";print /\{[^0]*\}/g'...
perl -nle '$,=",";print /\{[^0]*\}/g' filename
10,460
Posted By royalibrahim
vi +<nth_occurrence>/<search_pattern> ...
vi +<nth_occurrence>/<search_pattern> <input_file> will solve your problem
7,323
Posted By ygemici
it does not work..must add a `$` to before the...
it does not work..must add a `$` to before the val
size=`ls -l $val | awk '{print $5}'`
Forum: Programming 07-25-2011
3,905
Posted By Corona688
If fgets didn't null-terminate for you, how could...
If fgets didn't null-terminate for you, how could you possibly know where the NULL belongs? fgets terminates for you, like most string functions.
1,321
Posted By alister
Additionally, after XYZ, one would need to test...
Additionally, after XYZ, one would need to test for blanks or end of line.

(Yes, I am aware that what follows is a nitpick. ;))

The standard doesn't specify space and tabs but blank characters...
1,654
Posted By jayan_jay
One more way... code: ----- cat input |...
One more way...

code:
-----
cat input | paste - - | awk ' { print $8 " - " $11 } '
1,233
Posted By Corona688
I'm guessing the first b.txt is a typo then,...
I'm guessing the first b.txt is a typo then, since the file is a.txt?

A slight change to that awk script might work, then:

#!/bin/sh

# Usage: SCRIPT file1 file2 ...

# If you don't have...
9,664
Posted By rdcwayx
no, the same file is read two times. and I...
no, the same file is read two times.

and I test the code in Solaris, still get right output.

Do you download the latest gawk version?



This looks more simple.

but I have to change the...
13,023
Posted By alister
He should have grouped the commands: sed...
He should have grouped the commands:
sed '/Hello/ {n; s/Name/IDENTITY/;}'

And judging from the sample data, it'd be a good idea to anchor the regular expressions to the beginning of the line.
...
Showing results 1 to 21 of 21

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