755 reputation
69
bio website
location
age
visits member for 4 years, 1 month
seen Aug 4 at 8:45

Apr
12
comment Is there any alternative to grep's -A -B -C switches (to print few lines before and after )?
The shift @A if push(@A,$_)>7; bit only keeps an array of maximum size 7 around. (that's your -A parameter). The second option keeps an incredibly small file around (just run the perl without the sed outer layer to see what is generated there), but it does read the file twice.
Feb
3
comment Changing the PS1 on an interactive bash subshell easily
The usecase is pretty simple... the utility does a fairly complex transformation on a vendor's code repo, importing it to a local mercurial repo. Prints a bunch of status details out (like how many roots/heads/branches the resulting repo has), and then launches a shell to let the user investigate further. When they finish, the script asks if it should continue with the "difficult to undo" parts of the process. (In summary... privs aren't an issue here, but I want to make the users as comfortable with their own settings as possible)
Oct
19
comment Globally stop editors from creating ~ files
Downvotes? Seriously?
Sep
28
comment Is there a basic tutorial for grep, awk and sed?
Most 'advanced AWK' is probably better done with perl or python or whatever, but the simple stuff is nice to do with just awk.
Aug
17
comment Isn't less just more?
FreeBSD has them hardlinked, for one.