Reputation
Next tag badge:
972/1000 score
232/200 answers
Badges
13 128 265
Impact
~3.6m people reached

Feb
24
comment A batch that cout the number of occurrences
grep -ci A ~/dico.txt. See also: fold -w1 ~/dico.txt | sort | uniq -c
Feb
24
comment eval limitation with piped commands
Great answer. Same issue with yes 1 | head -n 5000 | paste -sd '^' | bc or gawk "$(yes 1 | head -n 5000 | paste -sd '^')"
Feb
23
revised eval limitation with piped commands
added 83 characters in body
Feb
23
revised Match lines not ending with an specific character
simplified
Feb
23
comment Does LVM support unwritten extents?
What matters is the file system you put on top of that LV. LVM or partitions or full disks just give you a block device, unwritten extents are irrelevant to them.
Feb
23
comment tail-ing a filename that is a date
ITYM DOUBLE-QUOTE YOUR VARIABLES!
Feb
23
comment execute a command in $PATH matching a wildcard
@mikerserv, no, $path and $PATH are tied. Any modification of one is reflected in the other. See the description of typeset -T.
Feb
23
comment execute a command in $PATH matching a wildcard
@mikeserv, it reports the key, so the command name, the normal $PATH lookup will invoke the first in $PATH for the greatest version of libreoffice (and $commands[cmd] is the first cmd in $PATH, it's just that if you have /bin/libreoffice4.2 and /usr/bin/libreoffice4.1, the first solution may very well return libreoffice4.1 even if /bin is before /usr/bin in $PATH). In zsh, the $path array is tied to the $PATH scalar (a feature borrowed from csh)
Feb
23
revised execute a command in $PATH matching a wildcard
added 539 characters in body
Feb
23
comment execute a command in $PATH matching a wildcard
Again, application means the user of that API that POSIX specifies. A POSIX script should not use an empty component, a POSIX implementation (of the API, as in sh), must consider an empty component as meaning the same as . (as specified in the description of $PATH there)
Feb
23
comment execute a command in $PATH matching a wildcard
application in the posix spec is on the user side. It just says one shouldn't use values of PATH like :/bin:/usr/bin (that one is the default for execp on GNU/Linux) implementations are still required to treat that empty component as the current directory.
Feb
23
revised execute a command in $PATH matching a wildcard
added 241 characters in body
Feb
22
comment execute a command in $PATH matching a wildcard
Strictly speaking, :: could occur more than once in $PATH. You may want to consider the case where $PATH is set but empty as well (replace with .).
Feb
22
comment execute a command in $PATH matching a wildcard
An empty $PATH means search in the current directory, /bin: means search in /bin and current directory. For an unset $PATH, that depends on the shell, check my answer on the why not use which question. See @Gilles' for a more correct method.
Feb
22
comment execute a command in $PATH matching a wildcard
IFS=:; $PATH splits /bin:/usr/bin: into (/bin /usr/bin) in POSIX shells, not (/bin /usr/bin '') (exception with zsh in sh emulation, yash, pdksh and older versions of mksh)
Feb
22
comment execute a command in $PATH matching a wildcard
Fails if $PATH contains empty components. Also, note that IFS considers : as a delimiter, not separator as you'd need to process $PATH (values of $PATH like /bin:/usr/bin: are not unusual)
Feb
22
answered execute a command in $PATH matching a wildcard
Feb
22
revised Is there a way to add a directory to my PATH in zsh only if it's not already present?
added 30 characters in body
Feb
22
revised Replace case-insensitive string in all folder files
deleted 33 characters in body; edited title
Feb
22
revised Replace case-insensitive string in all folder files
portability notes.