Better HN
topnewbestaskshowjobs
Log inSign up

kakulukia

1 karma · joined Jun 9, 2020 (6y ago) · 2 submissions

Submissions

comment 2y ago · link · parent

Thx for this!

comment 4y ago · link · parent

If you are polite, it works:

alias please='sudo zsh -c "$(fc -ln -1)"' # rerun the last command with sudo (because it failed )

Easier PATH management:

# nicer path configuration and lookup function path { if [[ $# -eq 0 ]]; then echo -e ${PATH//:/\\n} | sort elif [[ "$1" == "--save" ]]; then path $2 && echo "\npath $2" >> $HOME/.profile else if [[ -d "$1" ]] ; then if [[ -z "$PATH" ]] ; then export PATH=$1 else export PATH=$1:$PATH fi else echo "$1 does not exist :(" return 1 fi fi }