Reputation
539
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
2 8
Impact
~21k people reached

  • 0 posts edited
  • 2 helpful flags
  • 53 votes cast
Jun
12
comment Adding paths to PATH using a multi-line syntax
+1 (This question is tagged zsh)
Feb
6
comment sed into csv format
Why sed and not awk (or perl or python or ...)?
Feb
4
comment How do I delete this folder in Solaris?
Nasty! Glad you found it.
Feb
4
comment How do I delete this folder in Solaris?
@KentPawar: I've updated my answer accordingly. I'm not sure it warranted a downvote as it was a reasonable response to the question as it stood at the time with double-quotes.
Aug
7
comment How can I print lines from file backwards (without using “tac”)?
@Peter: Personally I'd use tac.
Jan
8
comment Testing C++ code with bash commands
Why have you posted this here and there?
Dec
18
comment How to name a file in the deepest level of a directory tree
N.B: If you just want to print the filename, you can omit deepest=$( [...] ) and start from find. It's not really clear what you're trying to achieve.
Dec
18
comment How to name a file in the deepest level of a directory tree
I see. There are many ways to solve this. I recommend my own solution since it involves only one |, keeping subprocesses to a minimum.
Dec
18
comment How to name a file in the deepest level of a directory tree
Your one-liner is incomprehensible to me. I'm sorry I cannot debug that for you. Does my example not do what you asked for?
Dec
17
comment How to name a file in the deepest level of a directory tree
Why should they be one-liners? As you've seen , when a one-liner goes wrong, it's very hard to debug! Open an editor and write a bash script!
Dec
17
comment How to name a file in the deepest level of a directory tree
Why do so many people try to do so much on one line? I don't get it!
Oct
4
comment How to group grep results?
Take a look at Ack betterthangrep.com
May
11
comment loop curl get request bash
If ${author} includes spaces or similar characters, you will want to URL encode them, otherwise you may find you get errors like code 400, message Bad request syntax ('GET /authors?string=shakespeare, w.&proc=39 HTTP/1.1') from your HTTP server.
Apr
2
comment Switch from grep to sed
@fred.bear: Thank you. And thanks for pointing out that I didn't need gsub. The check for 1987 could be localised to the end of column 2, thus: awk -F':' '$2 ~ /\.1987$/ {sub(/,.*/, ""); print}' students.txt
Mar
18
comment A problem with find and grep
This assumes GNU grep, of course.
Mar
18
comment How do I reuse the last output from the command line?
I use `!!` all the time.
Mar
18
comment A problem with find and grep
fg is a shell builtin, I recommend you chose a different name whether you implement this as an alias or (better still) a function.
Mar
16
comment How can I print lines from file backwards (without using “tac”)?
It's a famous sed one-liner. See "36. Reverse order of lines (emulate "tac" Unix command)." in Famous Sed One-Liners Explained for a full explanation of how it works.