Search Results

Search: Posts Made By: wabard
2,910
Posted By wabard
Might as well include an example in awk.... ...
Might as well include an example in awk....



awk ' { gsub("file://","",$2) ; printf("%s %g\n",$2,$4)} ' filename
7,423
Posted By wabard
??? Link seems pretty clear to me, including...
???

Link seems pretty clear to me, including the examples. How would you like it worded or expanded?
1,575
Posted By wabard
Alternate solutions similar to your original...
Alternate solutions similar to your original method...


cat test.txt | awk 'BEGIN { v=$NUM } {print ($NF - v ) } '
The BEGIN section is executed prior to the main body of code. Here we load...
92,539
Posted By wabard
Actually, there is nothing that states that's not...
Actually, there is nothing that states that's not the way it is suppose to be done. If it works, do it. I agree the potential exists for this to be "wasteful" ... dangerous?, maybe... I've been...
Forum: What is on Your Mind? 08-30-2011
14,680
Posted By wabard
I stand corrected... just downloaded and read...
I stand corrected... just downloaded and read the following... [0801.4031] Distant future of the Sun and Earth revisited (http://arxiv.org/abs/0801.4031)

it looks like the previously held view...
4,538
Posted By wabard
I believe you are confusing programming versus...
I believe you are confusing programming versus what is a maintenance command... I agree that programming is getting lax, no doubt, as software gets more and more bloated over time ( I use a...
4,538
Posted By wabard
I'm not convinced that in today's world of fast...
I'm not convinced that in today's world of fast CPU's that this is overly important, but I do concede the point with respect to the total number of processes. The main advantage of using the -exec...
4,538
Posted By wabard
I note a lot of people use xargs (quite...
I note a lot of people use xargs (quite useful)... however, the find command has a -exec option which seems to not be very popular (I use it all the time :cool:)


find DIR -name '*.sh' -exec...
Forum: What is on Your Mind? 08-29-2011
14,680
Posted By wabard
I think #1 is out, as the Earth's orbit will...
I think #1 is out, as the Earth's orbit will widen as the sun starts to expand and will most likely survive. The impact theory has a much higher chance of causing the earth to dive into the sun, but...
Forum: What is on Your Mind? 08-28-2011
14,680
Posted By wabard
???? I assume you mean how will planet earth...
????

I assume you mean how will planet earth end and not civilization / humans.... as the title of this thread is "How Will the World End?" A bit pedantic I know, but hey... I'm an engineer and...
3,041
Posted By wabard
Try this strawman and expand as required... ...
Try this strawman and expand as required...


#!/bin/sh
for i in `ls -R`
do
cat $i | grep "Hello World"
done
Note this only return the string. If you want to include the filename as well,...
Forum: Open Source 04-17-2010
197,868
Posted By wabard
My 1st was Slackware in late 1993, or was it...
My 1st was Slackware in late 1993, or was it 1994? (second beta if I recall correctly)... distributed on 3.5" floppies... used the distro for quite a while until RedHat came out. Switched to Fedora...
1,522
Posted By wabard
Love amitranjansahu's solution... Another...
Love amitranjansahu's solution...

Another thread awhile back similar in nature...

My solution -> https://www.unix.com/302298638-post10.html

(Original thread ->...
2,840
Posted By wabard
https://www.unix.com/shell-programming-scripting/10...
https://www.unix.com/shell-programming-scripting/105029-awk-program-3.html#post302298986 Should get you started. If you follow the basic logic, the script loads the files into an array and dumps it...
5,159
Posted By wabard
This is the correct answer.
This is the correct answer.
5,159
Posted By wabard
Well, I'm a little disappointed at the responses...
Well, I'm a little disappointed at the responses on this one... so... I'll try something a little different.

In your script, the return of 2 is happening for a very specific reason. I'll give...
8,413
Posted By wabard
Meh... I'm too old school.. I always export for...
Meh... I'm too old school.. I always export for completeness... not necessary in this case, since all variables are internal to the script itself...


Good catch and good point.
2,111
Posted By wabard
Dummy variable to force the while to loop...
Dummy variable to force the while to loop forever... you exit out of the infinite loop with the "break" statement.

Note: I made a mistake in the "cp" command line option in the example above...
Forum: What is on Your Mind? 03-19-2009
8,128
Posted By wabard
I'm in Australia, nice place to visit, but you...
I'm in Australia, nice place to visit, but you don't want to live here... (48.5% taxes)... :(

I've lived and worked in a lot of places around the world. My home is and always will be the good...
Forum: What is on Your Mind? 03-19-2009
27,681
Posted By wabard
Whisky, Wine, Women.. oh wait... one of those is...
Whisky, Wine, Women.. oh wait... one of those is not a drink... even though I've referred to one of those items as a "tall cool drink on a hot day"...
8,413
Posted By wabard
Please include your solution in the future to...
Please include your solution in the future to help others out...

FYI... the following should work. Note that the -F parameter is to specify a field separator, in this case, ":".

In a Bourne...
Forum: Solaris 03-19-2009
24,907
Posted By wabard
Correct link... Network Information Service...
Correct link...

Network Information Service - Wikipedia, the free encyclopedia (http://en.wikipedia.org/wiki/Network_Information_Service)
2,111
Posted By wabard
#!/bin/sh i=1 while(a=1) do if...
#!/bin/sh

i=1

while(a=1)
do
if test -e "FILE."$i
then
let i+=1
else
break
fi
done

cp -f FILE FILE.$i
4,588
Posted By wabard
As a starting point, you may want to review the...
As a starting point, you may want to review the following, https://www.unix.com/shell-programming-scripting/105029-awk-program-3.html#post302298986

Files are read into a two-dimensional array and...
14,945
Posted By wabard
Isn't this valid for Linux only?
Isn't this valid for Linux only?
Showing results 1 to 25 of 37

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