Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

automatically turn previous command into an alias



Hi

# automatically turn previous command into an alias

> alias mkal='_f(){_al=$(history -n -1 -1 | sed "s#\\\\n##" ); alias $1="$_al" ; alias -L "$1"};_f'

> ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head

> mkal psq

> psq

PID PPID CMD %MEM %CPU

3393 2374 /usr/lib/firefox/firefox 10.0 3.6 119165

3364 /usr/lib/thunderbird/thunde 7.2 30.4

.. etc


any improvements, easier way etc



Messages sorted by: Reverse Date, Date, Thread, Author