Search Results

Search: Posts Made By: qneill
5,757
Posted By qneill
I imagine your "2>/dev/null" is supressing an...
I imagine your "2>/dev/null" is supressing an error message, try redirecting it to a log file to debug.

# Schedule for deletion
echo "sudo /bin/rm -f \"/$rootdir/$vendor/$outgoing/.$line\"" | \
...
29,510
Posted By qneill
Nice catch, set -f is the answer as you explained...
Nice catch, set -f is the answer as you explained in your post.



Agreed, I was printing as an illustration that uses the extracted value, the assumption being the programmer using the code will...
29,510
Posted By qneill
iterating over split string values
This comes up enough I thought I'd drop it here (so the next time I need it I can google for it :)

Using "IFS", "set", and "for without the in keyword".

Note this will stomp on any arguments...
18,483
Posted By qneill
PIPESTATUS and autoconfigure
At the risk of sounding like a hermit (talking to myself), I recently examined some of the configure scripts and saw several patterns:

There aren't many pipe commands after all, mostly simple sed...
30,994
Posted By qneill
First try ssh -v -v user@remote and see...
First try

ssh -v -v user@remote

and see if something is happening on the client side. You should see the public key being offered as part of the handshake.

You may need a new ssh (key...
2,794
Posted By qneill
Umm, you will probably need to post some more...
Umm, you will probably need to post some more information about what you are doing. The two outputs you show are your "result", but from what action? Are you setting up a web server?
Are you...
27,182
Posted By qneill
If the original poster was close enough for only...
If the original poster was close enough for only this to remain:



and if he could change his output separator from " " to some other character, say "@" it would be a simple matter of

nawk...
3,760
Posted By qneill
I thought awk scanned files sequentially? not...
I thought awk scanned files sequentially? not sure what you script will do.
Consider using python...
import sys
l1 = open(sys.argv[1]).readlines()
l2 = open(sys.argv[2]).readlines()
if...
9,487
Posted By qneill
Might I suggest as well: @@ -29,6 +29,7 @@ ...
Might I suggest as well:

@@ -29,6 +29,7 @@
rm -f $TEMP $TEMP.diff
else
mv $TEMP $SIGS
+ chmod 600 $SIGS
echo "No prior existing report."
fi

--
qneill
53,824
Posted By qneill
No reason you have to use a "here script" with...
No reason you have to use a "here script" with <<EOF, you can pipe commands directly to the standard input of ssh, for example using echo:

$ D=/tmp; F1=x1; echo "F2=$D/$F1
echo on \$(hostname):...
3,187
Posted By qneill
setting the system date
Okay so I'm not really a newbie, but this bugs the crap out of me (rant on).

Every so often I need to change the system time. I run "man date" and always find the "date -s" command, but for who...
7,897
Posted By qneill
Try: SQL insert syntax - Google Search...
Try:
SQL insert syntax - Google Search (http://www.google.com/search?hl=en&q=SQL+insert+syntax)

I think you want
INSERT INTO "table_name" ("column1", "column2", ...)
VALUES ("value1",...
1,984
Posted By qneill
What's wrong with the code now? Doesn't work?...
What's wrong with the code now? Doesn't work? Hard to maintain? Slow?

At first blush, when I see "if [ nawk ... elif [ nawk ..." it really makes me want to convert the whole damn thing to a real...
3,651
Posted By qneill
Somewhere during your login sequence on pebblz01,...
Somewhere during your login sequence on pebblz01, something is prompting you for "Your login" and "Your passord". This could be from several things, depending on how the admin set things up.

Try...
9,417
Posted By qneill
Also, I looked at the code I posted, I had...
Also, I looked at the code I posted, I had changed your "mailx ...." line into "echo mailx ...." so that particular version is just going to show you the output, not actually do anything. Taking the...
9,417
Posted By qneill
Just another dude chiming in to help. ...
Just another dude chiming in to help.


Taranjeet - I must second Zaxxon's request for more output (using set -x) - it really helps when you include your work in progress (output, descriptions)...
18,483
Posted By qneill
But how does one do it in a shell that doesn't...
But how does one do it in a shell that doesn't have PIPESTATUS? I know that autoconf (tool to install source on almost Unix that has lots of shell-independent logic in it) plays tricks with...
15,752
Posted By qneill
ruby one liner
If your input is indeed fixed width, here's a one-liner in ruby:
$ ruby -e 'STDIN.readlines.each { |l| puts "#{l[3..7]} #{l[8..-1]}" if l[0..2] == "***" }' <filename

And the same sort of thing...
11,145
Posted By qneill
A good debugging technique in most shells is to...
A good debugging technique in most shells is to use "-x" which prints each command as it is executed. I put your commands in a script named 'yourscript'

bash$ cat yourscript ...
47,135
Posted By qneill
How about a 'bigdu' script
I solved this problem so many times I finally wrote a real script, it allows summing of the directory content sizes down to level N:

http://www.theneills.org/src/scripts/bigdu.ksh

-- ...
1,583
Posted By qneill
As long as we're calling external programs: ...
As long as we're calling external programs:
echo I love scripting | python -c "import sys; a = sys.stdin.readline().split(); a.reverse(); print ' '.join(a)"

echo I love scripting | ruby -e "puts...
31,221
Posted By qneill
I don't understand your question Are you...
I don't understand your question

Are you copying a file named "XXXX1234.ABCDEF" to "XXX1234"? (#1)

Or are you transforming one file to another and transforming the contents from...
66,892
Posted By qneill
When doing bulk removes, I do it in stages:...
When doing bulk removes, I do it in stages: generate the list, examine, then do the remove. Then I can check that I'm aiming for the correct foot One Last Time(tm) before shooting.

In the case...
Showing results 1 to 23 of 23

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