Re: [Fish-users] external command inside function fails on OSX

2016-12-01 Thread Greg Reagle
When troubleshooting, reduce as many differences as possible. Your command in the script and you interactive command are different. In the script: diskutil erasevolume HFS+ ramdisk $ramdiskpath Interactively: diskutil erasevolume HFS+ ramdisk "/dev/disk1" ---

Re: [Fish-users] external command inside function fails on OSX [SOLVED]

2016-11-30 Thread Dave Cottlehuber
On Wed, 30 Nov 2016, at 16:49, Bram Geron wrote: > Perhaps the output of hdiutil attach isn't what you expect. What if you > put "echo -n $ramdiskpath | xxd" in between? Awesome protip Bram! : 2f64 6576 2f64 6973 6b31 2020 /dev/disk1 000c: 2020 2020 2020 2020 0920 2020 . 000

Re: [Fish-users] external command inside function fails on OSX

2016-11-30 Thread Kurtis Rader
The problem is the output of `hdiutil` includes trailing spaces and tabs: $ hdiutil attach -nomount ram://2097152 | od -tx1z 000 2f 64 65 76 2f 64 69 73 6b 36 20 20 20 20 20 20 >/dev/disk6 < 020 20 20 20 20 09 20 20 20 20 20 20 20 20 20 20 20 >. < 040 20 20 20 20 2

Re: [Fish-users] external command inside function fails on OSX

2016-11-30 Thread Glenn Jackman
What's the output of that `hdiutil` command? Does that out span multiple lines? On Wed, Nov 30, 2016 at 8:14 AM, Dave Cottlehuber wrote: > Hi fisherfolk, > > This is a copy-pasta function from my previous zsh setup, on OSX., to > create a ramdisk of X Gb. Unfortunately the final command, diskut

Re: [Fish-users] external command inside function fails on OSX

2016-11-30 Thread Bram Geron
Perhaps the output of hdiutil attach isn't what you expect. What if you put "echo -n $ramdiskpath | xxd" in between? Cheers, Bram -- Bram Geron Doctoral researcher in computer science On Wed, 30 Nov 2016, at 02:32 PM, Dave Cottlehuber wrote: > On Wed, 30 Nov 2016, at 14:40, Diego Zamboni wrote:

Re: [Fish-users] external command inside function fails on OSX

2016-11-30 Thread Dave Cottlehuber
On Wed, 30 Nov 2016, at 14:40, Diego Zamboni wrote: > I'm not sure how PATH settings are propagated through functions. One > quick > solution would be to just use the full path for all commands (e.g. > /usr/sbin/diskutil). Thanks Diego, It's definitely not a path issue as the preceding diskutil .

Re: [Fish-users] external command inside function fails on OSX

2016-11-30 Thread Diego Zamboni
I'm not sure how PATH settings are propagated through functions. One quick solution would be to just use the full path for all commands (e.g. /usr/sbin/diskutil). On Wed, Nov 30, 2016 at 2:14 PM, Dave Cottlehuber wrote: > Hi fisherfolk, > > This is a copy-pasta function from my previous zsh set

[Fish-users] external command inside function fails on OSX

2016-11-30 Thread Dave Cottlehuber
Hi fisherfolk, This is a copy-pasta function from my previous zsh setup, on OSX., to create a ramdisk of X Gb. Unfortunately the final command, diskutil erasevolume ... fails unless run manually. I've tried sleep 5, sprinkling quotes, wrapping it in (...) but nada. Any idea why? fish 2.3.1 via ho