975 reputation
410
bio website none
location Massachusetts
age 40
visits member for 2 years
seen 18 hours ago

Software engineer and bash aficionado.


18h
comment Bash string concatenation used to build parameter list
You can, but you shouldn't. Arrays were added specifically to avoid this use of eval.
Aug
19
awarded  Yearling
Aug
12
comment Why is 'kill -9' killing browser as well as server?
Unrelated, but are you sure you need kill -9? There are other signals you can try if the default doesn't work.
Aug
12
comment How to use " rm !(*keyword) in bash 4.1.2?
You also need to disable history expansion to prevent the ! from being parsed as such before the shell gets to the filename generation.
Aug
12
comment Parenthesis in bash arithmetic: 3 * (2 + 1)
Aside from readability, it also doesn't require forking an extra process to do the arithmetic; it's handled by the shell itself.
Aug
8
answered Why does ls accept duplicate switches?
Aug
8
comment Disable glob qualifiers in zsh
@Gilles Thanks for the correction; muscle memory is hard to overcome :)
Aug
7
comment Is there a way to bypass .zshrc on login?
Wouldn't your first statement be due to using bash as your login shell on the remote machine, as opposed to any inherent difference between bash and zsh?
Aug
7
answered Disable glob qualifiers in zsh
Aug
7
comment Expand shell variable without globbing
@StéphaneChazelas Very interesting bit of historical trivia about bash 2.0!
Aug
6
answered Persistent directory stacks across sessions in zsh
Jul
1
comment readarray (or pipe) issue
See the bash man page. In short, it's syntax for treating a pipeline as a file descriptor. < <(...) means to redirect input (the first <) from the output of the command inside <(...). Similary, > >(...) would pass standard output to the standard input of the pipeline inside >(...). You don't necessarily need to use redirection with process substitution. cat <( echo a b c ) works as well.
Jun
9
answered readarray (or pipe) issue
May
27
answered bash completion on posix mode
May
14
comment Passing named arguments to shell scripts
Related to this, if the -k option is set in the calling shell, then my_script p_out='/some/path' arg_1='5' has the same effect. (All arguments in the form of an assignment are added to the environment, not just those assignments preceding the command.)
May
14
comment What is the purpose of .bashrc and how does it work?
@IlmariKaronen Since .bashrc isn't intended for use by other shells, it's better not to source it from .profile (which might be used by other non-bash shells).
May
11
awarded  Revival
May
11
answered execute bash script inside .bashrc
May
7
comment Create global enviromental variable after boot
This is an XY problem: your real problem is that gpg-agent is not configured properly, and you think that the solution is to set an environment variable visible to all processes.
May
6
comment What does “if [ -e $name ]” mean? Where $name is a path to a directory
[ and test are indeed the same program (and the POSIX spec requires them to be). Someone in the dim recesses of time thought that providing a synonym for test--right down to the required but unused ] argument--was a good idea, but it's just been a source of confusion for countless beginners who think the [ and ] really are shell syntax.