Question

I cannot get aliases to work correctly in my Terminal.app. I created a ".profile" file in my home directory (/Users/my_username) using:

touch ~/.profile

Then I opened this file using TextEdit and entered the following:

PS1="(\!) \w: "

alias rm=“rm -i”
alias cp=“cp -i”
alias mv=“mv -i”

The PS1 line works fine but every time I start up a new window in the Terminal.app it reads out the following:

-bash: alias: -i”: not found
-bash: alias: -i”: not found
-bash: alias: -i”: not found

I have read it may have to to with my .bashrc file but I have no idea where to find this and was under the impression that I could get aliases to work without editing that file.

What should I try next?

Was it helpful?

Solution

Your problem is with the "smart quote" “ ” characters; replace those with the normal quote character ".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top