Regarding my last post. I was wrong. My two liner still adds a blank line to my tmp file. Just wanted to clear that up give credit where it's due.
PHV's right on the money with his examples.
Actually, it doesn't to anything to the text file. It just prints the results of the command to the screen. Also piping a text file into sed is not the most efficient way to use sed. Here's a better example and also overwrites the input file. Make a copy of text file first in case you screw it...
Does ubuntu do the things that you need to? If so then who cares? Not real Linux? Thats BS. I still talk to old grumpy unix guys who turn their nose up to linux only because it's not what they've grown to know and use. Sounds like your friend. IMO, Linux is not Linux if you install proprietary...
PHV,
Yes, that works also. The awk example feherke gave is very similar to yours too. However, your example causes two writes to disk, right? Or is the first cached? I'm probably being a bit too anal about it but my two liner only causes one write and therefor is the more efficient solution in...
thanks, but your examples still leave a blank line *IF* the line is just 'newfile:/path/to/file'. They do work on the other lines however.
But I've figured it out with sed!
sed -e 's/newfile.*//' -e '/^[ ]*$/d' /tmp/tmpfile.tmp
the second sed expression removes the blank line(s).
So using the...
...That causes problems down the road. Yes, i'm sure I could just use another command to remove blank lines, but for the sake of efficiency, would rather not.
the sed that I used is
sed 's/newfile.*//' /tmp/tmpfile.tmp
Perhaps it could be modified as well. Trying awk this time.
Thanks for any help.
My script is setup to display an image every 6 seconds. If not a new jpeg is present in the "bucket", it displays "the next jpeg in line". This 6 seconds is enough time for a large jpeg to transfer over, BUT, we're using wireless networking and sometimes latency prevents the jpeg to copy over...
Here's the deal....
/dir/A is a bucket that I shoot large JPEGS into from a camera.
I have a script running that monitors this bucket and if it sees a new jpeg file in it, it displays the jpeg onto my screen. :-)
However, since the file is really large, sometimes the script tries to display...
How about a database, php, and perl support along with a ftp server, phpAdmin, all glued together nicely in a super simple installation to go with that web server? Try xampp.
1. download the latest installation to your /opt directory as root.
2. type: tar xzvf xampp-latest-version.tar.gz...
I have a USB thumbdrive thats got DSL (damn small linux) on it. I boot my PC with it. I love it. I'd like to "clone" this USB thumbdrive to another USB thumbdrive to have as a backup. Perhaps there's a tool or command to help me out? Thanks for any help.
a lot of distros come with a nice tool called netconfig.
You can run it from the command line (as root) and it'll go through step by step to configure a network interface.
Hello Perl gurus. I'm new to perl and so far I'm having some great success and fun with it. Just one quick question...
I need to install the module Math::Fraction
It's not in my distros repository so being a newb I just can't seem to find a good source for help. I've had lots of luck with...
I'm not at a term right now, but try:
before...
if [ ! -f /dira/$base.b ] -o [ ! -f /dirb/$base.b ]
after...
if [ ! -f /dira/$base.b -o ! -f /dirb/$base.b ]
John and Dianne both have user accounts on a linux box thats running postfix and pop3d. John and Dianne can both email each other on the linux box just fine with the mail command.
However, when John or Dianne use the windows PC in the other room to access their email with ThunderBird client...
John and Dianne both have user accounts on a linux box thats running postfix and pop3d. John and Dianne can both email each other on the linux box just fine with the mail command.
However, when John or Dianne use the windows PC in the other room to access their email with ThunderBird client...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.