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

Reply via email to