13,216 reputation
22542
bio website
location
age
visits member for 3 years, 11 months
seen 22 hours ago

Dec
17
answered piping in real time
Nov
20
answered Set custom added PATH vars to work in each Terminal session
Nov
16
comment Can't type letter 'm' in bash
@kashminder, so you found it? what is it?
Nov
15
answered Can't type letter 'm' in bash
Nov
11
reviewed Reject Reasons why crontab does not work
Nov
4
comment Mount and unmount network shares using bash with different credentials for each user on login/logout?
Is NFS instead of CIFS an option?
Nov
3
answered bash script to check if input has an @
Oct
21
comment Deleting input back to the last forward slash
Good answer. More commonly you'd enclose the whole setting in single quotes with the bind command; bind '"\ew": backward-kill-word', but that's nitpicking. And it may be worth mentioning that you can also put "\ew": backward-kill-word in ~/.inputrc, in which case other commands that use readline will also have that binding, e.g. if you enable readline in the python interactive shell, that binding will also apply there.
Oct
19
comment How to move files based on first word in file name?
Note that it fails if the filename contains " quotes. This is because you inject data into code, which is something you generally want to avoid (think Bobby Tables). Even worse, it may run arbitrary code by specially crafted filenames: e.g. if you run touch 'dog ".`mktemp`.".jpg' before that find command, mktemp will actually be run.
Oct
19
answered How to move files based on first word in file name?
Oct
17
revised Reasons why crontab does not work
rolled back to a previous revision
Oct
17
comment Difference between echo -e “<string>” and echo $“<string>”
Also worth noting that both Chet and POSIX recommend using printf rather than echo
Oct
17
comment gibberish command not found on bash terminal startup
I usually recommend PS4='+ $BASH_SOURCE:$LINENO:' bash -xlic "" for debugging the initialization files.
Oct
16
comment Move Files To Directories Based on File Name
Note that [A-M] will typically be equivalent to something like [AaBbCc...LlM] in most locales, depending on how the given language sorts things lexicographically. May also include non-ascii letters the current language happens to sort in between there. In this case, this is probably ok, but may be worth noting. To have it mean [ABCDEFGHIJKLM], set LC_COLLATE=C (or since bash 4.3 there's also: shopt -s globasciiranges). Don't you just love locales? :)
Oct
15
comment Reasons why crontab does not work
@ulidtko ... or when the cronjob suddenly stopped working because you installed package foo, which happened to install a command in /usr/bin with the same name as one you use from someApp, but doing something completely different, of course. That could have disastrous effects. You obviously have to trust that the commands in /opt/someApp/bin are not malicious. If there are malicious commands in there, the system administrators have done a poor job.
Oct
15
comment Reasons why crontab does not work
@ulidtko, I'd say no, you'd typically want the executables in /opt/someApp/bin to take precedence over commands that happen to have the same name in other directories. The order was intentional.
Oct
2
revised How can I decode a base64 string from the command line?
Include example of a longer string
Oct
2
comment How can I decode a base64 string from the command line?
@morloch or just avoid removing the newlines from the base64 encoded data, and it works as expected...
Sep
30
awarded  Explainer
Sep
11
comment How to see the command attached to a bash alias?
bash has no which command.