The fact that there is a "Won't do list" stating that functions won't be supported...
I don't think this is anything more than a toy to play with rust.
I don't think this is anything more than a toy to play with rust.
Me too. Looking at them, they all start with something like
test $# -eq 2 || return
...since in sh/bash you cannot even name your function's arguments or indicate how many you expect to receive.Speaking of primitiveness, in strict POSIX sh, there's no such thing as local variables in functions!!
For example:
export MARKPATH=$HOME/.marks
function jump {
cd -P $MARKPATH/$1 2> /dev/null || (echo "No such mark: $1" && marks)
}
function mark {
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
}
function unmark {
rm -i $MARKPATH/$1
}
function marks {
ls -l $MARKPATH | sed 's/ / /g' | cut -d' ' -f9- && echo
}
_jump()
{
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "$( ls $MARKPATH )" -- $cur) )
}
complete -F _jump jump
This would be much harder to do in a script.I would probably use Python, Go or Powershell.
http://users.eecs.northwestern.edu/~jesse/pubs/caml-shcaml/
Incidentally, that would also dramatically decreased security and maintainability problems.