`export` is `set -x` in fish.  Without quotes you get a list which when
exported is joined with a colon; useful for $PATH but not $EDITOR:

$ set -x EDITOR 'sublime -w'

$PATH is a list in fish and when you use a list as an unquoted part of an
argument you get a cartesian product, similar to brace expansion:

$ echo PATH=$PATH
PATH=/bin PATH=/sbin

Obviously not what you want in this case.  If you quote a list variable
it's joined with a space:

$ echo "PATH=$PATH"
PATH=/bin /sbin

Not what you want either.  If you don't have any spaces in any of the items
in your $PATH you can just substitute space for colon:

$ echo "PATH=$PATH" | tr ' ' :
PATH=/bin:/sbin

Redirecting output to a file and chmod is the same as in zsh, but note that
config.fish is sourced even when running scripts and with fish -c.  You may
want to check if the shell is interactive:

if status --is-interactive
   do-the-above
end

Hope that helps!


On Thu, May 23, 2013 at 2:10 AM, Yvon Thoraval <yvon.thora...@gmail.com>wrote:

> actually I'm using zsh as a shell, i plan to switch to fish.
> i don't know how to do some lines (from .zshrc) in config.fish :
>
> export EDITOR='sublime -w'
>
> could it be translated to :
> set EDITOR sublime -w
> (the -w arg is mandatory)
>
> also i do have actually :
> echo PATH=$PATH > .profile
> echo PATH=$PATH > ~/.ssh/environment
> echo PGDATA=$PGDATA >> ~/.ssh/environment
> chmod 0600 ~/.ssh/environment
> (chmod 600 is mandatory)
>
> that is writing to a file.
>
> --
> Yvon@48.871651804,2.384858688
>
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to