In Multics, there were something like four different controls in the command processor to address problems like this, each of which performed requoting, each with slightly different semantics and producing slightly different results, and all useful in different contexts. (http://www.mirrorservice.org/sites/www.bitsavers.org/pdf/honeywell/multics/AG92-06B_multicsCmds_Nov87.pdf, page 3-322.)
As far as I know, Unix has never had any such facility. > On Sep 26, 2017, at 9:17 PM, Michael <[email protected]> wrote: > > > On 2017-09-26, at 7:50 AM, @lbutlr <[email protected]> wrote: > >> On Sep 26, 2017, at 8:44 AM, @lbutlr <[email protected]> wrote: >>> pushd "$(tmutil latestbackup)$(ls -d `find /Volumes/ -maxdepth 1 -type l >>> -print` | sed 's/\/Volumes\///')$(pwd -P)" >> >> AFAIC, this works and is shorter, but I don't use pushd myself: >> >> pushd "$(tmutil latestbackup)$(ls -d `find /Volumes/ -maxdepth 1 -type l` | >> sed 's/\/Volumes\///')" > > Lacking the current directory at the end, it can't work. > > The longer one? > keybounceMBP:Library michael$ pushd "$(tmutil latestbackup)$(ls -d `find > /Volumes/ -maxdepth 1 -ty > pe l -print` | sed 's/\/Volumes\///')$(pwd -P)" > ls: cannot access '/Volumes//New': No such file or directory > ls: cannot access 'Main': No such file or directory > -bash: pushd: /Volumes/TimeMachine/Backups.backupdb/Keybounces MacBook > Pro/2017-09-26-184525/Users/michael/Library: No such file or directory > > ... Yea, my root volume has a space in the name "New Main". > > So how badly can I nest "$( ? > > keybounceMBP:Library michael$ pushd "$(tmutil latestbackup)""$(ls -d "$(find > /Volumes/ -maxdepth 1 > -type l -print) | sed 's/\/Volumes\///')""$(pwd -P)" >> > > Missed one, try again > > keybounceMBP:Library michael$ pushd "$(tmutil latestbackup)""$(ls -d "$(find > /Volumes/ -maxdepth 1 > -type l -print) | sed 's/\/Volumes\///')")""$(pwd -P)" > ls: cannot access '/Volumes//New Main | sed '\''s/\/Volumes\///'\'')': No > such file or directory > -bash: pushd: /Volumes/TimeMachine/Backups.backupdb/Keybounces MacBook > Pro/2017-09-26-184525/Users/michael/Library: No such file or directory > keybounceMBP:Library michael$ > > Argh. > > Anyone? The nesting needed to deal with filenames containing space in a shell > designed around "spaces break tokens, no files will ever have a space in > their name" has gotten beyond me here. > > _______________________________________________ > MacOSX-talk mailing list > [email protected] > http://www.omnigroup.com/mailman/listinfo/macosx-talk _______________________________________________ MacOSX-talk mailing list [email protected] http://www.omnigroup.com/mailman/listinfo/macosx-talk
