0
I know bashrc
is executed on terminal startup. But my use case is something like this,
To execute a specific command, say ls
, whenever user executes another specific command, say cd
, on the terminal.
My current solution is overriding cd
command. But again that I feel is not a good solution. But my restriction here is that my user-group may not be aware of this new command that I may create and continue using cd
.
Possible, but not a good idea to override commonly-used builtins. Rather create a new function like
cdl
. – slhck – 2018-06-05T07:12:17.147Updated my question a bit. I already have overrided the
cd
command but I am hoping there may be a better solution. – swayamraina – 2018-06-05T07:22:17.390Either the builtin is overridden and then
cd
can do something else, or it's not overriden and thencd
is just a regularcd
. Are you asking how to force other users to use your overriddencd
? – Kamil Maciorowski – 2018-06-05T08:05:59.060So, Yes I think I can take a flag which will decide this enhanced behaviour of
cd
– swayamraina – 2018-06-05T08:30:50.840