Migrating from bash
Most of your bash knowledge carries over unchanged. This page covers what to move and what differs.
Check your scripts first
Section titled “Check your scripts first”grfsh --check ~/.bashrc ~/bin/*.sh--check parses each script without running it and lists syntax errors, bash features grfsh does not support, and commands it cannot find, with line numbers. A clean result means the script only uses features grfsh implements.
Scripts with #!/bin/bash keep running under bash whatever your login shell is, so you only need to port what you want grfsh itself to run.
Moving your rc file
Section titled “Moving your rc file”| bash | grfsh |
|---|---|
~/.bashrc |
~/.grfshrc or ~/.config/grfsh/grfshrc |
~/.bash_profile, ~/.profile |
~/.grfsh_profile or ~/.config/grfsh/profile |
~/.bash_history |
~/.grfsh_history |
Usually the quickest start is to copy the parts you care about:
grep -E '^(export|alias) ' ~/.bashrc >> ~/.grfshrcthen move functions over one by one and run grfsh --check ~/.grfshrc.
What changes
Section titled “What changes”| bash | grfsh |
|---|---|
PS1='\u@\h:\w\$ ' |
configure-prompt, or GRFSH_PROMPT='{user}@{host}:{cwd}$ ' |
PROMPT_COMMAND=fn |
precmd() { fn; } |
bind '"\C-g": ...' |
bindkey '^G' action or bindkey -s '^G' 'text\n' |
complete -F _func cmd |
complete -C 'command that prints words' cmd, complete -W 'a b c' cmd |
let x=x+1 |
(( x++ )) or x=$((x + 1)) |
shopt -s extglob with !(*.txt) |
files | where name !~ '\.txt$' | get name, or a loop with case |
declare -n ref=name |
${!name} for reading, printf -v "$name" for writing |
select choice in a b c |
read -p with a case |
history -c |
history -c |
fc |
!!, !n and history |
Things grfsh adds
Section titled “Things grfsh adds”- Autosuggestions, highlighting and completion without bash-completion or ble.sh.
zfor frecent directories and auto cd.- Typed tables:
files,procs,search,git-status,load,where,sort-by,to json. timeouton macOS,replace,write-file,explainand agent mode.
Bash features grfsh does not have
Section titled “Bash features grfsh does not have”See Compatibility with bash for the full list.