I want other developers to have some convenient methods. Therefore I want to give them a script, that automatically sets an alias.
E.g the command
grunt compileModule:[modulename] should set the alias
cprev to be this exact command. The command should still be executed after setting the alias!
As we are commonly working multiple days on the same module, the alias should also get an entry in the
~/.bashrc file (this is the main 'feature', so whenever they close the bash, they dont need to put in the whole command on reentering)
Now there are many posts about
historyand how to look up which commands where run last, etc., but I could not find out how to sort of 'concatenate' all the information to result in what I need.
I was thinking creating an alias for
alias grunt='~/myScriptForAliasHistory.sh;grunt $1';
would that be suitable?
to make this more clear:
The original command is
and it should be working like this after the modification.
It should only do an additional step, so you can call the same function as
as well (with the same parameters)
The workflow could look like this:
- Developer starts working on a new module. In order to compile it, he writes
- The same developer needs to restart his bash/pc/console. Now he does not want to write the whole command again, but wants to only type
cprev(which then executes
- The next day he starts working on module
[anothername], so he executes
- If he now restarts, the command
In other words:
grunt compileModule is called, it should overwrite the alias
cprev with its own current call parameters.