I would like to alias python with ipython only when no arguments are follows so that I can use ipython's shell and its autocompletion feature. For example:
#This should start the ipython shell
python
#These should run python as usual
python -c "print(100)" #run print in python
python --version #run python --version
I am trying with something like
python() {
if [ "$#" -eq 0 ];
then
ipython
else
eval $(printf "%q " "python $@") #python --help: command not found
#eval $(printf 'python %s\n' "$@") #infinite loop calling python function
fi
}