19,257 reputation
34072
bio website
location United States
age
visits member for 3 years
seen 6 hours ago

Debian user, GNU/Linux enthusiast, FLOSS supporter, hobby developer.


May
18
comment Is there an online bash script testing site?
I ran across ideone, an interesting site, in the past. I haven't used it much nor can I vouch for its accuracy or POSIX compliance or usefulness, but it does include bash version 4 as one of the languages you can supposedly test online.
May
16
comment UID of a deleted account
@XinHua If you have tens of deleted users with files still lying around you should probably do some clean-up anyways.
May
14
comment How to write bash script that deletes the oldest file in a directory if there are greater than N files in the directory?
Why all the down-votes? BTW, possibly relevant reading.
May
14
comment UID of a deleted account
Actually, GNU find has the -nouser test for this purpose - it tests true for files whose uid does not correspond to any user on the system.
May
14
comment How can I expose JAVA_HOME to applications running under X and/or Gnome?
Can you clarify what you mean by "ignored"? If the environment variable is indeed set but its value is not being used, then you have a Java configuration problem, and not an environment issue. I have never needed to set $JAVA_HOME but I always use the distribution's pre-packaged java install.
May
14
comment Formatting the output: Underlining
@rahmu Sorry, I got carried away and didn't realize ksh88 lacked the decrement operator :). A pure POSIX-sh approach would not be much different from what you wrote, just with different test and arithmetic operators. The tput approach is entirely dependent on the terminal. If you want your script to be portable, it's probably not a good idea to assume things about the user's terminal.
May
14
revised Formatting the output: Underlining
added 35 characters in body
May
14
revised Formatting the output: Underlining
added 159 characters in body
May
14
answered Formatting the output: Underlining
May
13
comment Linux: create list of text with multiple operators
@FrederikNielsen If the ability to reasonably complete your task also implies the ability to brute-force 128-bit symmetric encryption and 160-bit hashes, then no I would not call it practical. If you are or ever become a pointy-haired boss, I'd hate to be one of your employees ... :P
May
12
comment How to remove the (1) from filenames using the find command
@DQdlM The snippet I posted above is just find invoking sh with fairly portable POSIX syntax. For more details, you can check out the section on Parameter Expansion, the section on compound commands that explains the for loop, and the POSIX find spec. In addition to those resources, I'd be happy to answer any specific questions you have.
May
12
revised VIM jump from one xml tag to the closing one
deleted 7 characters in body
May
12
comment Shell script filtering through jpg files attributes
First you need a tool to read EXIF data from JPG files. If you already have one, post it and try to figure out how to use it. If not exiftool seems to be popular.
May
11
revised Shell script filtering through jpg files attributes
added 1 characters in body; edited title
May
11
revised VIM jump from one xml tag to the closing one
added 15 characters in body
May
11
comment Why does mutt retain deleted emails in view until you “sync your mailbox” using $?
I suppose some mutt dev long ago decided on this for the default behavior. Showing deleted messages allows you to select and undelete them. If you don't ever intend to use the undelete function, then you could always remap the d key to <purge-message> instead of <delete-message>.
May
11
comment How to remove the (1) from filenames using the find command
@yarek Thanks for the catch. The biggest difference between this and the sed pipe approach is this is much safer. It's still easier to read than regex backslash soup, provided you understand some basic shell scripting constructs.
May
11
revised How to remove the (1) from filenames using the find command
added 6 characters in body
May
11
answered How to remove the (1) from filenames using the find command
May
11
revised PHP file permissions for Development machine
deleted 6 characters in body