Skip to content

Instantly share code, notes, and snippets.

@listenlight
Created October 23, 2022 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save listenlight/7257d9f79137bb358fe33a044e20a1e2 to your computer and use it in GitHub Desktop.
Save listenlight/7257d9f79137bb358fe33a044e20a1e2 to your computer and use it in GitHub Desktop.
apps='ps cexmo pid,user,comm | gvg -E '\''(nginx|puma|redis|postgresq|apache|bundler|ruby|/gem|sidekiq)'\'
#!/bin/zsh
function ww() {
wcmd=$1
echo $'\e[1;34m'$(which $wcmd)$'\n\e[0m\e[0;34m'$(whereis $wcmd)$'\e[0m';
}
function addalias() {
read 'tmpAlias?shortcut: '
read 'tmpCmd?full command: '
cmd_str="alias $tmpAlias=\"$tmpCmd\""
the_rest=" >> ~/.aliases && . ~/.aliases"
echo "echo \""$cmd_str""$the_rest"\""
confirm="Y"
read "confirm?is that ok (y/N): "
if [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]]; then
echo $cmd_str >> ~/.aliases && . ~/.aliases
echo "neat"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment