Ok, thanks for all support.
To summarise, the problem comes from the pseudo-tty assignment in ssh. When
something in a command substitution (command) assign a pseudo-tty fish
replaces this with nothing (and actually swallow surrounding text ?!).
Disabling pseudo-tty allocation solves this.
For reference, this is what I ended up with:
function vip
vagrant ssh $argv[1] -c "ifconfig eth1 | sed -ne 's/.*inet
addr:\(\S*\)\s*Bcast.*/\1/p'" -- -T ^ /dev/null
end
function vurl
open "http://"(vip)"$argv[2]/$argv[1]"
end
I'll guess I should report a bug on this:
$ echo "Say "(ssh -T HOST echo Hi)"!"
Killed by signal 1.
Say Hi!
$ echo "Say "(ssh -t HOST echo Hi)"!"
$
Regards
Rickard
On Wed, Aug 20, 2014 at 4:44 PM, Michael Stillwell <m...@beebo.org> wrote:
> > On Wed, Aug 20, 2014 at 3:05 PM, Glenn Jackman <jack...@pythian.com>
> wrote:
> >>
> >> This got me at first too. Command substitution returns a *list*, not
> just
> >> a string. When you prefix a list with a string ("http://"), that
> string is
> >> prefixed onto each member of the list:
> >>
> >> $ function tmp; echo 1; echo 2; echo 3; end
> >> $ echo "foo"(tmp)
> >> foo1 foo2 foo3
> >>
> >> If the list is empty, the string is prefixed onto nothing, hence the
> empty
> >> output.
>
> Wow, interesting that "foo (...)" might behave so differently to
> "foo(...)"!
>
> Playing with this a bit:
>
> $ echo foo (echo "bar baz")
> foo bar baz
> $ echo foo(echo "bar baz")
> foobar baz
> $ echo foo (echo -e "bar\nbaz")
> foo bar baz
>
> But (!):
>
> $ echo foo(echo -e "bar\nbaz")
> foobar foobaz
>
>
>
>
> Michael
>
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds. Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users