Skip to content

AndersDJohnson/alias-echo.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

alias-echo.sh

Like shell's alias, but first echos the underlying command before running.

Useful for learning, so you don't look like an idiot when you stray from your own shell.

Use

Import the script then define alias(es), e.g., in your shell init script:

source ~/libs/alias-echo.sh/alias-echo.sh

alias-echo grin grep -rin

Now you can use it:

> grin var ~/code
grep -rin var /Users/abc/code
/Users/abc/code/project/index.js:3: var name = 'project';

If you want to temporarily disable echoing, e.g., to pipe output, set a value for the environment variable NO_ALIAS_ECHO, e.g.:

NO_ALIAS_ECHO=1 grin var ~/code | whatever

Known to work in Bash and Zsh.

Used by

About

Like shell alias, but echo first.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages