Search Results

Search: Posts Made By: SandmanCL
1,099
Posted By SandmanCL
Recording stats for Comcast
The last few weeks I've had a problem with Comcast in San Francisco (anyone else sharing the same issue ? Please share !)

During the late afternoon throughout early morning hours I see a high...
1,509
Posted By SandmanCL
Perfect ! That gave me exactly what I needed :-)
Perfect ! That gave me exactly what I needed :-)
1,509
Posted By SandmanCL
Need AnyEvent help
I'm trying to learn AnyEvent but have very little experience with event handlers in general and have a hard time grasping the concept.

What I need is a script that runs as a daemon, watches some...
7,409
Posted By SandmanCL
Sorry, there was a typo in the script. The last...
Sorry, there was a typo in the script. The last line should be "done" instead of "fi". I've updated the code in post #4
7,409
Posted By SandmanCL
replace "/path/to/yourdir" with whatever it...
replace "/path/to/yourdir" with whatever it should be and copy the script to clipboard

cat > script

paste content of clipboard and hit ctrl-d

chmod 755 script

and then run the script
...
7,681
Posted By SandmanCL
I don't know DOS well at all but I doubt "uniq"...
I don't know DOS well at all but I doubt "uniq" is there either. But then again, why would you need that ? Each filename has to be unique. Try to avoid system() and backtick calls to have your script...
7,409
Posted By SandmanCL
Try this #!/bin/sh for file in `ls...
Try this

#!/bin/sh

for file in `ls /path/to/yourdir`; do
if [ -z `"echo $file | egrep '^...-..-....\.jpp|^...-..-....-.mi\.jpg'"` ]; then
echo $file
fi
done
7,409
Posted By SandmanCL
Not too elegant, but this perl example should...
Not too elegant, but this perl example should print a list of files that don't match your patterns:

#!/usr/local/bin/perl

$\ = "\n";

@files = split/\n/,`ls /path/to/your/dir`;
foreach...
112,055
Posted By SandmanCL
As far as I know, there's not option to grep for...
As far as I know, there's not option to grep for 'only return last line'.
As ajcannon said; piping the output into tail -1 is probably your best bet.
9,450
Posted By SandmanCL
I should have mentioned that I have to stick with...
I should have mentioned that I have to stick with 5.8.5 compatible code here. This needs to get deployed on multiple servers where a perl upgrade is not an option.

Currently I am moving away from...
9,450
Posted By SandmanCL
Thanks for your answer. I did find the join()...
Thanks for your answer. I did find the join() method but what confuses me is that I can't (as far as I can tell) wait for each thread in parallell, which sort of defeats the purpose:



In the...
9,450
Posted By SandmanCL
In need of multi threaded perl assistance
I need to write a perl script to execute external programs and grab the output and return code. Each program should be killed if it has not completed within X seconds.

Imagine that the script goes...
42,534
Posted By SandmanCL
most likely you'll end up with a solution...
most likely you'll end up with a solution involving paste and awk.

If each file has two columns the command would be
12,441
Posted By SandmanCL
Krrishv, I was running this under Linux. I...
Krrishv, I was running this under Linux.
I didn't know the behavior of sed varied that much between different flavors, but I guess you're right:

I just tried my command on a FreeBSD box and it...
12,441
Posted By SandmanCL
\U means "convert to uppercase" and shouldn't be...
\U means "convert to uppercase" and shouldn't be confused with the "u" in united ;)

The sed command I provided will uppercase whatever letter you throw at it (at least us-ascii):


$ for...
12,441
Posted By SandmanCL
That won't work. This will, though: $ echo...
That won't work. This will, though:

$ echo united | sed 's/^\(.\)/\U\1/'
United
12,441
Posted By SandmanCL
using perl
Sort of cheating since it requires perl installed:

$ echo united | perl -pe 's/^(\w)/\u$1/'
United
Showing results 1 to 17 of 17

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