I can't seem to get $_ to output the name of the script.  Sometimes
it's blank, and sometimes ".".

For example, "echo $_" in my ~/.config/fish/config.fish outputs a blank line.

Some other experiments:

  $ echo $FISH_VERSION
  2.0.0
  $ cat foo.fish
  echo $_
  $ fish foo.fish
  [blank line]
  $ . foo.fish
  .

Compared to bash:

  $ cat foo.bash
  echo $0
  $ bash foo.bash
  foo.bash
  $ . foo.bash
  bash



Cheers,
Michael

On Tue, Jun 11, 2013 at 3:56 PM, Alex Boisvert <alex.boisv...@gmail.com> wrote:
> Try $_
>
> from http://fishshell.com/docs/2.0/index.html#variables
>
>
> On Tuesday, June 11, 2013, Michael Stillwell wrote:
>>
>> Is there a fish equivalent of $0 (the full pathname of the running
>> script)?  (Or indeed any way to determine what directory a script is
>> in, from within the script itself?)
>>
>>
>>
>>
>> Michael
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Windows:
>>
>> Build for Windows Store.
>>
>> http://p.sf.net/sfu/windows-dev2dev
>> _______________________________________________
>> Fish-users mailing list
>> Fish-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/fish-users

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to