Reputation
1,386
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
1 7 18
Impact
~79k people reached

Jul
24
comment How can I make a script to count up by fives?
This isn't an OS difference per se. It's a version difference. OS X only has BASH 3 OOTB. You can install a BASH from this century using almost any OS X package manager. I use Home Brew, for one.
Jul
12
comment Not able to cat a string from a file under a string of another file
ed "$file" <<< w will write trailing new lines to a file lacking one.
Jun
12
awarded  Famous Question
Jun
11
comment How can I put a bit mask on /dev/zero so that I can get bytes other than zero?
@Peter.O I'm not sure how you interpreted my comment to mean anything other than the literal, static expression yes 1 | tr -d $'\n'. I suppose you could use a shell that doesn't do the $'' backslash treatment, or you could try to find a locale that alters tr -d $'\n', but I haven't found it yet.
Jun
10
comment How can I put a bit mask on /dev/zero so that I can get bytes other than zero?
Or use yes 1 | tr -d $'\n' for that matter.
Jun
8
comment Issue an error when using empty shell variables
If PROJECT_HOME is set, but the name is not a directory, then [[ -d $PROJECT_HOME ]] && rm -r "$PROJECT_HOME" will do nothing, silently. But [[ -z $PROJECT_HOME ]] || rm -r "$PROJECT_HOME" will silently delete "$PROJECT_HOME", even if it's a file that is not a directory. Getting an error message is never a problem: if [[ -d $PROJECT_HOME ]]; then rm -r "$PROJECT_HOME"; else printf '%s is not a directory\n' "$PROJECT_HOME" >&2; fi
Jun
8
comment Issue an error when using empty shell variables
-z is ok, but since $PROJECT_HOME is supposed to be a directory, maybe -d would be better. [[ -d $PROJECT_HOME ]] && rm -r "$PROJECT_HOME".
May
29
awarded  Nice Question
May
21
comment Why is nullglob not default?
I get the impression some think it should be obvious that nullglob should be enabled by default. I don't think it's obvious. That expansions happen in the shell before command invocation means that expanding to nothing is a less intuitive behavior than the glob remaining unchanged.
Apr
16
accepted Cannot (force) remove directory in Docker build
Apr
13
revised Cannot (force) remove directory in Docker build
edited title
Apr
13
asked Cannot (force) remove directory in Docker build
Apr
10
comment Can't run php cli at webuser but will run as root
This is a little tricky, then. I'm under the impression the problem is environmental more than permissions. Can you compare the output of env in both cases? It might also help to see the contents of that script. Can you share?
Apr
9
comment Can't run php cli at webuser but will run as root
In your tests, did you try to run this from the commandline yourself, both as root and as www? Or are you comparing commandline root to www triggered from a cronjob or fpm?
Mar
29
comment How can I create new shell commands?
Or, create a shell function.
Mar
9
comment Repeatedly execute bash command while there's no output from another process
Can you show how you're using it?
Mar
8
awarded  Revival
Mar
7
revised Repeatedly execute bash command while there's no output from another process
More precise timing
Mar
7
answered Repeatedly execute bash command while there's no output from another process
Mar
7
comment Writing a character N times using the printf command
dd if=/dev/zero bs=5000 count=1 | tr '\0' H