vendredi 30 janvier 2015

Bash escaping is confusing me


Lets say that I have a file (executable) called literally 'a\b'. It just echoes some stuff. Now I want to call that and I can do it by inputting



user@machine:~/test$ ./a\\b


into my console. Now lets write this into a variable



user@machine:~/test$ COMMAND="./a\\b"


and now I want to execute this file 'a\b' by using backticks. Here is the result:



user@machine:~/test$ `$COMMAND`
a: command not found
user@machine:~/test$


So, here is my question: How can I make this work?


Ive tried numerous ways and played around with '' and multiple backslashes in COMMAND but nothing worked...


** I know its senseless but I just want to know how bash and `` work together to interpret things... **


THX


FW



Aucun commentaire:

Enregistrer un commentaire