Reputation
39,367
Next tag badge:
103/100 score
18/20 answers
Badges
8 60 104
Newest
 Yearling
Impact
~4.1m people reached

12h
awarded  Yearling
1d
awarded  Good Answer
Apr
4
awarded  Notable Question
Mar
31
awarded  Populist
Mar
15
awarded  Good Answer
Mar
15
awarded  bash
Feb
29
awarded  Good Answer
Jan
11
revised Linux/Windows/Unix/… file names: Which characters are allowed? Which are unescaped?
fixed broken link
Dec
23
awarded  Nice Answer
Dec
20
awarded  Nice Answer
Dec
15
awarded  Enlightened
Dec
15
awarded  Nice Answer
Dec
8
comment Display \n characters as newlines when using tail?
@Kdansky: You didn't show how you defined the alias or what kind of problem you're having so I can only guess. One problem you may be having is with quoting. An extra backslash may help: alias forward="tail -f file | sed 's/\\\n/\n/g'". If you want to be able to specify the filename as an argument, you should use a function instead of an alias: forward () { tail -f "$@" | sed 's/\\n/\n/g'; }
Nov
24
awarded  Good Answer
Nov
4
comment How do I get current Unix time in milliseconds using bash?
There's a potential problem running date multiple times. In some cases, the date or time may change between runs as your command is written. It's better to run date once and parse the parts out and do your calculation. One of several ways to do that would be t=$(date +%H%M%S); (( x = ${t:0:2} * 3600 + ${t:2:2} * 60 + ${t:4:2} )); echo "$x". This uses Bash syntax since the question is tagged bash. As you allude, your answer (and my variation) only gives seconds for the current day so far and not since the Epoch and not in millis.
Oct
14
revised How to create a UUID in bash?
additional information
Oct
14
comment How to create a UUID in bash?
@David: I believe it's part of the base operating system on OS X. I have no idea why one is upper case and the other is lower. It doesn't really matter since either represents valid hex characters (echo -e 'f\nF' | grep '[[:xdigit:]]' outputs both lines). If it does matter for you and you have Bash 4, you can do this to make it lower case: uuid=$(uuidgen); uuid=${uuid,,} or this to make it upper case: uuid=$(uuidgen); uuid=${uuid^^} or something along these lines to do a tolower() style test: if [[ ${uuid1,,} == ${uuid2,,} ]]
Oct
7
revised Apply multiple .patch files
deleted 1 character in body
Sep
30
revised Ways to set umask on Ubuntu for daemon processes
needs single quotes around awk script
Sep
28
awarded  Great Answer