89,501 reputation
12102216
bio website
location European Union
age
visits member for 2 years, 2 months
seen 12 hours ago

Jun
11
comment What's the difference between “realpath” and “readlink -f”
realpath has been in FreeBSD since 2002. Before that, pwd was doing it (since 2000, pwd some-file would call realpath() on file). Debian has had a realpath package since 1996. The one on IRIX probably predates it though I found no evidence other than it was in IRIX 6.5 in 1998. OpenBSD added a -f to readlink in 1997. GNU added readlink in 2003 and it had -f from the start.
Jun
11
comment What's the difference between “realpath” and “readlink -f”
readlink -f was in OpenBSD long before GNU. All of NetBSD, FreeBSD and OpenBSD now have readlink -f (your link even mentions it). realpath has been in FreeBSD and IRIX for a long time (don't know if it predates the one in Debian). HPUX and IRIX also have readlink, though not -f. The realpath package in Debian experimental is now the one from coreutils (as an experiment to see if it breaks things). The dwww realpath acts more like readlink -e while the GNU one like readlink -f so it's not a complete dropin replace
Jun
10
comment realpath command not found
Debian is now moving to GNU realpath. Why do you say it's deprecated? AFAICS GNU realpath has features (like --rel-path) which GNU readlink doesn't have. Many systems have a readlink(1) that is just an interface to readlink(2) (while realpath(1) is an interface to realpath(3))
Jun
10
revised Bash: Zipping/grouping files by common substring
deal with filenames starting with `-`.
Jun
10
comment Why don't my arrow keys work in sh?
@mikeserv, not sure what you mean, but to reiterate, all of fc, $FCEDIT, $HISTFILE, $PS1 are optional in POSIX (marked with UP for "User Portability"). The sh of Unix conformant systems will have those as UP is required for Unix conformance (among other things Unix also requires that echo -e outputs -e<LF>). But if a system/shell only claims POSIX conformance, then it doesn't need to implement those. For Debian ash, it may be enabled at compile time with --with-libedit as already mentioned, but Debian at least doesn't.
Jun
10
comment Bash: Zipping/grouping files by common substring
You also need to fix the locale to C (LC_ALL=C). Try for instance with a list of files like 3000_a_a.csv, 3000_a@b_a.csv, and 3000_a_c.csv in a typical en_US.UTF-8 locale. That's because in most non-C locales, _ is ignored (at first) for sorting.
Jun
10
comment Bash: Zipping/grouping files by common substring
If any of the cvs files in ~/home/file-directory-location are of type directory, then you will include all the regular files in there. I'm not sure what's the point of your find command there. You've got some missing quotes in there. You need LC_ALL=C for sort and uniq.
Jun
10
comment Bash: Zipping/grouping files by common substring
That assumes filenames don't contain space, tab newline, globbing (*, ?, [) characters. That will run the same zip commands several times.
Jun
10
revised Bash: Zipping/grouping files by common substring
added 209 characters in body
Jun
10
answered Bash: Zipping/grouping files by common substring
Jun
10
revised how to round trip a bash associative array to a text file?
rolled back to a previous revision
Jun
10
revised Making zsh default shell without root access
better to update SHELL as well, so that thingsl like xterm or vi... use zsh instead of bash when using a shell.
Jun
10
comment how to round trip a bash associative array to a text file?
@mikeserv, sure, but that's beyond the point of the answer. By all means, please do add proper syntax checking as appropriate. One may also want to check that there be an even number of arguments after the file name (or use the odd single argument as a means to remove a single element).
Jun
10
answered how to round trip a bash associative array to a text file?
Jun
10
comment how to round trip a bash associative array to a text file?
declare -p hash > file to save the hash associative array. source file to restore.
Jun
10
revised History of Bash globbing
added 168 characters in body
Jun
10
answered History of Bash globbing
Jun
10
comment History of Bash globbing
There's not much that bash did invent. bash mostly cherry-picked features from different shells (Bourne, ksh, csh, tcsh, zsh). Globbing predates even the Bourne shell and used to be done with a glob command (only ? and * were supported then) in the first versions of Unix in the early 70s.
Jun
10
comment History of Bash globbing
@richard, my ^[^.].*\.txt$ was to take into account the ignoring of dot files. Note that the -regex is a GNU extensions, some shells like ksh93 or zsh can incorporate regexps in their globs (try for instance: ksh93 -c 'echo ~(E:^[^.].*\.txt$)')
Jun
10
comment xdotool random/more natural delay?
With xte (from xautomation), you can insert arbitrary delays (including in between keypress and keyrelease events).