Search Results

Search: Posts Made By: yazu
2,733
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...
1,605
Posted By itkamaraj
rsync -vrz --copy-links --stats --exclude="*"...
rsync -vrz --copy-links --stats --exclude="*" $SOURCE/* $DESTINATION
2,508
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...
11,251
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...
101,278
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,084
Posted By dude2cool
# cat /tmp/yourinputfile|sort|./uniq -w 1
# cat /tmp/yourinputfile|sort|./uniq -w 1
1,392
Posted By alister
Distilling until nothing but the essence remains:...
Distilling until nothing but the essence remains:
awk -F\| '!a[$1]++' INPUTFILE
;)

Regards,
Alister
2,597
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
2,947
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
12,815
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,044
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 '<'...
12,815
Posted By radoulov
Consider the following: % cat infile ...
Consider the following:

% cat infile
adsf123
asdlfkjlasdfj
adsf123
asdfasdf12341234
asdfasdf12341234
asdlfkjlasdfj343
asdlfkjlasdfj56
adsf123
asdlfkjlasdfj
adsf123
asdfasdf12341234...
1,989
Posted By pravin27
perl -nle '$,=",";print /\{[^0]*\}/g'...
perl -nle '$,=",";print /\{[^0]*\}/g' filename
6,899
Posted By royalibrahim
vi +<nth_occurrence>/<search_pattern> ...
vi +<nth_occurrence>/<search_pattern> <input_file> will solve your problem
6,255
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,093
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.
909
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...
996
Posted By jayan_jay
One more way... code: ----- cat input |...
One more way...

code:
-----
cat input | paste - - | awk ' { print $8 " - " $11 } '
905
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...
5,230
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...
7,316
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

 

Featured Tech Videos

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