850 reputation
310
bio website none
location Massachusetts
age 40
visits member for 1 year, 11 months
seen Jul 11 at 17:50

Software engineer and bash aficionado.


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.
May
2
comment Is there a more succinct alternative to piping to wc for counting files in a directory
Keep in mind that ls | wc -l will give you the wrong count if any file names contain newlines.
May
2
comment How to fix 'set -o emacs' in .bashrc not working in ssh shell
I might have misread your question: the same home directory is mounted on all the machines?
May
2
answered How to fix 'set -o emacs' in .bashrc not working in ssh shell
May
1
comment How is `vi` Aware of the Format of Configuration Files?
A minor technicality: there are two processes involved. The syntax files are responsible for categorizing pieces of text (this string is an Integer), and a color scheme is used to define how different categories are displayed (make Integers blue).
Apr
29
revised Why Service accounts in Linux and Unix Systems?
Correct statement about ntpd and Postgres databases.
Apr
29
suggested suggested edit on Why Service accounts in Linux and Unix Systems?
Apr
29
comment Functions defined in .zshrc not found when running script
Functions defined in a script that is executed (not sourced) will not be available after that script completes.
Apr
28
comment why is setting a variable before a command legal in bash?
I neither claimed you need an explanation nor that anything can be expanded after the command runs. However, it is true that bash first parses the given command line, recognizes that there are two variable assignments to apply to the environment of the coming command, identifies the command to run (echo), expands any parameters found in the arguments, then runs the command echo with the expanded arguments.
Apr
28
comment why is setting a variable before a command legal in bash?
The pre-command assignments to x and y are for the environment that echo runs in, not the environment in which the arguments to echo are expanded. For IFS=, read xx yy zz, the entire string is read, unsplit, by the read command. Then, that string is split according to the value of IFS, with the corresponding pieces assigned to xx, yy, and zz.
Apr
28
answered Default function arguments (manually emitting bash psuedo-signals)
Apr
28
comment Have backticks (i.e. `cmd`) in *sh shells been deprecated?
My interpretation is that backquotes are supported purely because they are too entrenched in existing code to formally deprecate. I have never heard an argument for continuing to use them in new code.