382 reputation
16
bio website sourceforge.net/projects/…
location Northeast
age
visits member for 2 years, 7 months
seen 12 hours ago

Long time Linux user (currently kubuntu). Use Windows 98, and 7 when I have to. Programmed in many languages, currently using bash and awk for most things. Learning Python.

Have one project on sourceforge:

Duplex printing emulator for non-duplex printers (Linux)


Apr
20
comment Substituting strings in a very large file
Linux allows urls to have embedded multiple slashes in paths, so this code may fail if you have any of those. Testing for the whole string, http and all, won't have this problem.
Mar
29
comment Adding a user who can only execute scripts remotely
If you only want the user to be able to execute the commands from your directory (and there aren't too many), you could take the "prog" out of the read above and use a select statement to offer a text menu of choices of those programs and then do the read for the arguments. I would also test this to make sure what happens if you type a bunch of Ctrl-Cs at various points in the script. You may want a trap command in there too.
Mar
4
answered Is swap an anachronism?
Mar
4
answered Linux script or program to shorten filenames
Feb
4
comment Doing simple math on the command line using bash functions: $1 divided by $2 (using bc perhaps)
Thanks. I needed a simple calculator like that!
Feb
4
comment How can I source the bashrc file every time I 'clear'
Make sure your .bashrc script has no cumulative effects. If it does anything like appending things to your paths, it could get messy. In general, .bashrc is for initialising your shell environment. if it does other things, then it would be better to split them out into a new script and call that along with clear. Also, if anyone else uses your system or assists you, they may encounter unexpected behaviour because you have repurposed a common command.
Feb
4
comment Why do we need a firewall if no programs are running on your ports?
I'm not sure, but I believe DROP just doesn't respond so the requester doesn't even know if the request was received or if your machine exists. REJECT says you're definitely there and just don't want to talk about it. And, if something's behind a locked door, it might be worth trying to find a way in to find out what's worth protecting.
Jan
14
comment How to conditionally do something if a command succeeded or failed
Oops. You're correct.
Jan
14
answered Why is bash standard on Linux?
Jan
14
comment How to find application's path from command line?
I thought it was going come back with "42"! LOL.
Jan
14
answered How can I delete a file with no name
Jan
14
comment How to conditionally do something if a command succeeded or failed
@Keith-Thompson: Your way is a bit simpler and probably faster. I'm just used to coding in other languages and it just doesn't look right to me.
Dec
17
answered “Bookmarks” for bash
Dec
17
awarded  Commentator
Dec
17
comment “Bookmarks” for bash
+1 for set -P. Some of my symlinks were driving me crazy because I couldn't remember where they really went and didn't remember the command that shows that information.
Dec
11
comment How do I make multiple directories at once in a directory?
One thing to keep in mind is how your file names will be sorted when you list them or use them with wildcards like *. '11' will sort before '2'. This can be avoided if you arrange for all the numbers to be the same length with leading zeros. Dennis Williams shows how to do that in bash 4, but you can code your script to do it if you don't have bash 4.
Dec
11
answered How to quickly store and access often used commands?
Dec
9
comment volcopy for Linux?
Last I saw, partimage would only restore to a partition of exactly the same size as the original. So make sure your new partition is the same size and adjust it, if necessary, after the restore. I didn't know about the uuid issue.
Nov
25
comment How to redirect whatever I enter in terminal to file
+1 for ttyrec - yet another command I had never heard of before.
Nov
18
comment .bashrc overwritten but still sourced — how can it be recovered?
For the future: Backup your files so this isn't an issue. You might also consider creating a separate file for these quick add-ons and sourcing it somewhere like in .bashrc. Provides a basic safety net and you can easily turn it on and off as necessary.