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...
Hello all,
I have a temporary file and at any time it may have only one of the following lines or none at all (empty file).
AAA 50 50 60 60 90 90
or
AAA 60 60 60 60 80 80 newfile:/path/to/a/file
or
newfile:/path/to/a/file
Needing an awk in my shell script to remove only the...
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 believe i'm going in the right direction. I ran the command as root but I don't think it installed. Here's the output....
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Thu, 08 Mar 2007 23:09:20 GMT
Running install for module Math::Fraction
Running...
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.
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.