You need to convert each of the Bash commands in your ~/.bashrc script
to a Fish command, and put it in your fish initialization script.

Instead of 'export', use 'set -U'. Instead of '[', use 'test'. Instead
of the 'fi' keyword, use the 'end' keyword. Instead of defining
aliases, define functions, using the 'function' built-in. Instead of
'PS1', use 'PROMPT'.

To learn more, execute 'help'.


On Mon, Oct 22, 2012 at 9:56 AM, Federico Calboli <f.calb...@gmail.com> wrote:
> Hi!
>
> I'm trying to move to fish, but I want to keep my bash settings:
>
> (from .bash_profile)
>
> source ~/.bashrc
>
> # MacPorts Installer addition on 2010-03-17_at_21:13:03: adding an 
> appropriate PATH variable for use with MacPorts.
> export PATH=$PATH:/opt/local/bin:/opt/local/sbin
>
>
> # bash-completion
> if [ -f /opt/local/etc/bash_completion ]; then
>    . /opt/local/etc/bash_completion
> fi
>
> (from .bashrc)
>
> export TERM=xterm-256color
> # If running interactively, then:
> if [ "$PS1" ]; then
>
>
> # enable color support of ls and also add handy aliases
> #    if [ "$TERM" != "dumb" ]; then
>         alias ls='ls -FG'
>         alias rm='rm -i'
>         alias cp='cp -i'
>         alias mv='mv -i'
>  alias sudo='sudo '
>  #function trash { mv $@ ~/.Trash ; }
> #    fi
>    # set a fancy prompt
>    PS1="\[\e[0;32m\]\u@monkey:\w\$ \[\e[0m\]"
>    #PS1="\u@monkey:\w\$ "
> fi
>
> I Tried to use python to translate the bashrc in fish
>
> /usr/local/share/fish/tools/import_bash_settings.py < ~/.bashrc
>
> but the resulting file does not work:
>
> fish: Tokenizer error: 'Unexpected end of string, parenthesis do not match'
> /Users/greatsage/.config/fish/config.fish (line 8): set_default     PS1 
> ""\[\e[0;32m\]\u@monkey:\w\$ \[\e[0m\]" "
>                                                                        ^
> in . (source) call of file '/Users/greatsage/.config/fish/config.fish',
>         called on standard input,
>
> fish: Tokenizer error: 'Unexpected end of string, parenthesis do not match'
> /Users/greatsage/.config/fish/config.fish (line 8): set_default     PS1 
> ""\[\e[0;32m\]\u@monkey:\w\$ \[\e[0m\]" "
>                                                                        ^
> in . (source) call of file '/Users/greatsage/.config/fish/config.fish',
>         called on standard input,
>
> If I delete the prompt bit, I still get errors:
>
> fish: Unknown command 'set_default'
> /Users/greatsage/.config/fish/config.fish (line 1): set_default export TERM 
> "xterm-256color"
>                                                    ^
> in . (source) call of file '/Users/greatsage/.config/fish/config.fish',
>         called on standard input,
>
> fish: Unknown command 'set_default'
> /Users/greatsage/.config/fish/config.fish (line 2): set_default #    if [ 
> "$TERM" ! " "dumb" ]; then"
>                                                    ^
> in . (source) call of file '/Users/greatsage/.config/fish/config.fish',
>         called on standard input,
>
> fish: Unknown command 'set_default'
> /Users/greatsage/.config/fish/config.fish (line 3): set_default         alias 
> ls "'ls -FG'"
>                                                    ^
> in . (source) call of file '/Users/greatsage/.config/fish/config.fish',
>         called on standard input,
>
> fish: Unknown command 'set_default'
> /Users/greatsage/.config/fish/config.fish (line 4): set_default         alias 
> rm "'rm -i'"
>                                                    ^
> in . (source) call of file '/Users/greatsage/.config/fish/config.fish',
>         called on standard input,
>
> fish: Unknown command 'set_default'
> /Users/greatsage/.config/fish/config.fish (line 5): set_default         alias 
> cp "'cp -i'"
>                                                    ^
> in . (source) call of file '/Users/greatsage/.config/fish/config.fish',
>         called on standard input,
>
> fish: Unknown command 'set_default'
> /Users/greatsage/.config/fish/config.fish (line 6): set_default         alias 
> mv "'mv -i'"
>                                                    ^
> in . (source) call of file '/Users/greatsage/.config/fish/config.fish',
>         called on standard input,
>
> fish: Unknown command 'set_default'
> /Users/greatsage/.config/fish/config.fish (line 7): set_default   alias sudo 
> "'sudo '"
>                                                    ^
> in . (source) call of file '/Users/greatsage/.config/fish/config.fish',
>         called on standard input,
>
>
> How can I convert my bash stuff to have it in fish?
>
> Cheers
>
> F
>
> --
> Federico Calboli
> f.calb...@gmail.com
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to