LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   New problem with aliases (https://www.linuxquestions.org/questions/linux-newbie-8/new-problem-with-aliases-4175533043/)

battles 02-04-2015 09:15 AM

New problem with aliases
 
I have many .bashrc aliases. When I used to type in an alias, it just executed the alias. Now something has changed. When I type in the alias, it prints the alias lines and then executes the commands:

alias cde='cd /etc/ && ls --color -a' #get to /etc

root@me~# cde
cd /etc/
ls --color -a
...into /etc and list of folders/files follows...

How can I stop the

cd /etc/
ls --color -a

from being displayed?

Thanks.

veerain 02-04-2015 10:33 AM

I have read bash man page but the effect you are saying with alias is not documented there. May be I have missed it. Web search might help.

rknichols 02-04-2015 10:34 AM

Are all your commands being echoed back in that manner? That would indicate that you've set the "-v" option. Type "set +v" to turn it off.

On second thought, no, that wouldn't happen. The only other related option that I can think of is "-x", but with that the echoed lines would be prefixed with "+ ".

battles 02-04-2015 12:57 PM

That is apparently what happened. I tried to put in a command that had -x in it, but there were some additional single quotes in the string that I didn't see, so the -x was executed. After logging out and just now logging back in, the problem was gone - apparently resetting itself.


All times are GMT -5. The time now is 11:25 AM.