Why is my alias now not working?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
2
down vote
favorite
So before I reformatted (to get rid of Windows), I simply used this command to open documents by putting it at the end of the ~/.bashrc
file:
alias commandless= 'gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt'
But now everytime I start the terminal, it says:
bash: alias: gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt: not found
before even typing anything in, and when I run the command nothing happens, not even error messages.
command-line alias
add a comment |Â
up vote
2
down vote
favorite
So before I reformatted (to get rid of Windows), I simply used this command to open documents by putting it at the end of the ~/.bashrc
file:
alias commandless= 'gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt'
But now everytime I start the terminal, it says:
bash: alias: gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt: not found
before even typing anything in, and when I run the command nothing happens, not even error messages.
command-line alias
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
So before I reformatted (to get rid of Windows), I simply used this command to open documents by putting it at the end of the ~/.bashrc
file:
alias commandless= 'gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt'
But now everytime I start the terminal, it says:
bash: alias: gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt: not found
before even typing anything in, and when I run the command nothing happens, not even error messages.
command-line alias
So before I reformatted (to get rid of Windows), I simply used this command to open documents by putting it at the end of the ~/.bashrc
file:
alias commandless= 'gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt'
But now everytime I start the terminal, it says:
bash: alias: gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt: not found
before even typing anything in, and when I run the command nothing happens, not even error messages.
command-line alias
edited Oct 12 '15 at 15:38
![](https://i.stack.imgur.com/jszIp.jpg?s=32&g=1)
![](https://i.stack.imgur.com/jszIp.jpg?s=32&g=1)
kos
24.5k867115
24.5k867115
asked Oct 12 '15 at 15:17
thinksinbinary
3741615
3741615
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Use double quotes instead of single quotes:
alias newcommand="full path of the binary to be executed"
and not:
alias newcommand='full path of the binary to be executed'
No space near equal either on the left or on the right.
6
Using double-quotes doesn't change anything in this case, the problem is the space after the=
â kos
Oct 12 '15 at 16:35
There should not be any space between equal to
â AVS
Oct 12 '15 at 16:39
no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
â thinksinbinary
Oct 12 '15 at 16:45
That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
â kos
Oct 12 '15 at 16:48
3
@thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
â kos
Oct 12 '15 at 16:50
 |Â
show 2 more comments
up vote
20
down vote
You have a space between the =
and the opening '
. Remove it.
$ alias foo= 'bar baz'
bash: alias: bar baz: not found
1
Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
â glenn jackman
Oct 12 '15 at 16:49
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Use double quotes instead of single quotes:
alias newcommand="full path of the binary to be executed"
and not:
alias newcommand='full path of the binary to be executed'
No space near equal either on the left or on the right.
6
Using double-quotes doesn't change anything in this case, the problem is the space after the=
â kos
Oct 12 '15 at 16:35
There should not be any space between equal to
â AVS
Oct 12 '15 at 16:39
no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
â thinksinbinary
Oct 12 '15 at 16:45
That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
â kos
Oct 12 '15 at 16:48
3
@thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
â kos
Oct 12 '15 at 16:50
 |Â
show 2 more comments
up vote
1
down vote
accepted
Use double quotes instead of single quotes:
alias newcommand="full path of the binary to be executed"
and not:
alias newcommand='full path of the binary to be executed'
No space near equal either on the left or on the right.
6
Using double-quotes doesn't change anything in this case, the problem is the space after the=
â kos
Oct 12 '15 at 16:35
There should not be any space between equal to
â AVS
Oct 12 '15 at 16:39
no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
â thinksinbinary
Oct 12 '15 at 16:45
That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
â kos
Oct 12 '15 at 16:48
3
@thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
â kos
Oct 12 '15 at 16:50
 |Â
show 2 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Use double quotes instead of single quotes:
alias newcommand="full path of the binary to be executed"
and not:
alias newcommand='full path of the binary to be executed'
No space near equal either on the left or on the right.
Use double quotes instead of single quotes:
alias newcommand="full path of the binary to be executed"
and not:
alias newcommand='full path of the binary to be executed'
No space near equal either on the left or on the right.
edited Oct 12 '15 at 16:34
![](https://i.stack.imgur.com/jszIp.jpg?s=32&g=1)
![](https://i.stack.imgur.com/jszIp.jpg?s=32&g=1)
kos
24.5k867115
24.5k867115
answered Oct 12 '15 at 16:25
AVS
362
362
6
Using double-quotes doesn't change anything in this case, the problem is the space after the=
â kos
Oct 12 '15 at 16:35
There should not be any space between equal to
â AVS
Oct 12 '15 at 16:39
no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
â thinksinbinary
Oct 12 '15 at 16:45
That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
â kos
Oct 12 '15 at 16:48
3
@thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
â kos
Oct 12 '15 at 16:50
 |Â
show 2 more comments
6
Using double-quotes doesn't change anything in this case, the problem is the space after the=
â kos
Oct 12 '15 at 16:35
There should not be any space between equal to
â AVS
Oct 12 '15 at 16:39
no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
â thinksinbinary
Oct 12 '15 at 16:45
That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
â kos
Oct 12 '15 at 16:48
3
@thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
â kos
Oct 12 '15 at 16:50
6
6
Using double-quotes doesn't change anything in this case, the problem is the space after the
=
â kos
Oct 12 '15 at 16:35
Using double-quotes doesn't change anything in this case, the problem is the space after the
=
â kos
Oct 12 '15 at 16:35
There should not be any space between equal to
â AVS
Oct 12 '15 at 16:39
There should not be any space between equal to
â AVS
Oct 12 '15 at 16:39
no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
â thinksinbinary
Oct 12 '15 at 16:45
no, ABISHEK appears to be right, i had to remove the space and put in the quotes instead of the apostrophe
â thinksinbinary
Oct 12 '15 at 16:45
That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
â kos
Oct 12 '15 at 16:48
That I'm afraid still doesn't make the "use double-quotes" suggestion right. If you want to remove it, since it's wrong and misleading, I'll remove my downvote, however there's another answer pointing out the space problem which was posted 45 minutes before yours, so your answer is (aside from the single / double quotes thing) basically identical to the answer already present. It doesn't really add anything new.
â kos
Oct 12 '15 at 16:48
3
3
@thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
â kos
Oct 12 '15 at 16:50
@thinksinbinary Double-quotes are definetly not necessary. Try using single quotes instead, it will still work regardless.
â kos
Oct 12 '15 at 16:50
 |Â
show 2 more comments
up vote
20
down vote
You have a space between the =
and the opening '
. Remove it.
$ alias foo= 'bar baz'
bash: alias: bar baz: not found
1
Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
â glenn jackman
Oct 12 '15 at 16:49
add a comment |Â
up vote
20
down vote
You have a space between the =
and the opening '
. Remove it.
$ alias foo= 'bar baz'
bash: alias: bar baz: not found
1
Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
â glenn jackman
Oct 12 '15 at 16:49
add a comment |Â
up vote
20
down vote
up vote
20
down vote
You have a space between the =
and the opening '
. Remove it.
$ alias foo= 'bar baz'
bash: alias: bar baz: not found
You have a space between the =
and the opening '
. Remove it.
$ alias foo= 'bar baz'
bash: alias: bar baz: not found
edited Oct 12 '15 at 15:35
answered Oct 12 '15 at 15:23
glenn jackman
11.8k2241
11.8k2241
1
Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
â glenn jackman
Oct 12 '15 at 16:49
add a comment |Â
1
Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
â glenn jackman
Oct 12 '15 at 16:49
1
1
Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
â glenn jackman
Oct 12 '15 at 16:49
Especially with bash -- it parses the commands into tokens by whitespace, so it's extremely sensitive to stray spaces.
â glenn jackman
Oct 12 '15 at 16:49
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f684635%2fwhy-is-my-alias-now-not-working%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password