1
When I use commands like cvs commit -m .
I get rather annoying info that cvs is examining all directories.
To avoid it I can use cvs -q commit -m .
Can I do something so that cvs works silently for all operations without the option -q
?
1
When I use commands like cvs commit -m .
I get rather annoying info that cvs is examining all directories.
To avoid it I can use cvs -q commit -m .
Can I do something so that cvs works silently for all operations without the option -q
?
0
You can use an alias or a function for cvs
, eg:
alias cvs="$(which cvs) -q"
cvs() { $(which cvs) -q "$@"; } ; export cvs
An alias is valid for interactive commands in the current shell, while an exported function will work in subshells, including those created to run scripts.
Using which cvs
forces reference to the real binary file, bypassing any internal definitions, such as an alias or function. This stops any possibility of recursion. Note that using double quotes in the alias definition means that which cvs
is called only once, when the alias is defined; single quotes would call which cvs
whenever cvs
is typed.
But alias cvs=$(which cvs) -q
throws error:-
-bash: alias: -q: not found
– Soham Banerjee – 2018-04-25T12:01:39.937
@SohamBanerjee - Sorry, missed quotes. – AFH – 2018-04-25T13:15:01.573
You can use an alias or a function for
cvs
, egalias cvs=$(which cvs) -q
orcvs() { $(which cvs) -q "$@"; } ; export cvs
. An alias is valid for interactive commands in the current shell, while an exported function will work in subshells, including those created to run scripts. – AFH – 2018-04-25T11:16:15.940Thanks for the hint, although I used
alias cvs="cvs -q"
instead ofalias cvs=$(which cvs) -q
as it threw error...thanks again – Soham Banerjee – 2018-04-25T11:30:58.657Using
which cvs
forces reference to the real binary file, bypassing any internal definitions, such as an alias or function. This stops any possibility of recursion. – AFH – 2018-04-25T11:36:53.577I have submitted an answer, so that others with a similar problem can see that there is a solution. – AFH – 2018-04-25T11:44:03.130