Tag Info

Hot answers tagged


cat reads stdin if run without arguments. If you give it arguments, it will read the arguments and not stdin. If you want it to read both its argument files and stdin, make /dev/stdin one of the arguments (according to where you want it to go in the concatenation): cat 0<a /dev/stdin b c Notes: - or /dev/fd/0 also works 0< can simply be <


In <<<"$(<file)" (supported by zsh (where <<< was first introduced, inspired by the same operator in the Unix port of rc), ksh93 (the $(<file) operator was introduced by ksh), mksh and bash), For $(<file), the shell reads the content of the file (chokes on NUL bytes except for zsh), removes all the trailing newline characters and ...


All this commands will write the (txt) (do not try this over binary files) contents of a file: cat file cat <file echo "$(<file)" cat <<<"$(<file)" But that is because cat is a very adaptable command, Not because the commands are equal. The command cat file prints the contents of the file, cat in this case is acting over ...


In bash, if you do: $ cat <(ps -j) PID PGID SID TTY TIME CMD 3887 16480 16480 pts/29 00:00:00 bash 3888 3888 16480 pts/29 00:00:00 cat 3889 16480 16480 pts/29 00:00:00 ps 16480 16480 16480 pts/29 00:00:00 bash In zsh: $ cat <(ps -j) PID PGID SID TTY TIME CMD 3935 3935 16480 pts/29 00:00:00 ps 3936 3936 ...


Put quotes around INSTALL_LOG_OUTPUT in your function, like this: function install_log() { echo "$1" >> "$INSTALL_LOG_OUTPUT" 2>&1 } After running your script again, you will probably get an error message indicating that INSTALL_LOG_OUTPUT is empty, with a message of this sort: bash: : No such file or directory.


fuser was written to send part of the output to stdout and part of the output to stderr. This was done for two reasons: It means you can pipe all the matching pids to another process The POSIX standard said so It's not the easiest way to write and debug something but it has been a long-lived standard so love or hate it, that's the way it sends its ...

Only top voted, non community-wiki answers of a minimum length are eligible