Hi Patrick, > > The program can't know which. It shouldn't try and guess but > > instead just pass the argument to open(2), etc. > > That was pretty much my conclusion.
It's what wc(1), diff(1), etc., do. The programs which need to handle the ambiguity have options to direct them, e.g. pwd(1), du(1), and find(1). > If programs can't resolve relative paths in the same way that the > shell does, then I might have expected the shell to turn the relative > paths into absolute ones before passing them as arguments to programs. > > But that opens up a can of worms too. The shell (probably) can't know > whether I intend a string that looks like a relative path to be > treated as a reference to a file, or as a literal string that just > happens to look like a path, or as a path relative to something else > that the program is going to know about! Exactly. http://www.catb.org/~esr/jargon/html/D/DWIM.html > I have symbolic links to give the effect of selectively placing some > of the subdirectories of my home directory on an HDD. The rest of the > home directory is on an SSD. It has worked "well enough" for quite a > while now, but I suppose bind mounts might be a better idea. My /etc/fstab has /data/var-cache /var/cache none bind /data/usr-share /usr/share none bind /data/opt /opt none bind because one filesystem ran out of space and /data had space to offer. I do use symlinks, e.g. when working in a directory of cross-compiled C source, I want easy reference to the info(1) source files of the toolchain's commands so I have a ./info symlink which points to /usr/local/.../tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/share/doc/gcc-arm-none-eabi/info and want info/../pdf to be its sibling directory, not ./pdf. -- Cheers, Ralph. -- Next meeting: Online, Jitsi, Tuesday, 2020-12-01 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack: mailto:dorset@mailman.lug.org.uk