I have a shell script at /home/user/android-sdk-linux/tools. I wish to run the script from the terminal by typing ddms so I added :/home/user/android-sdk-linux/tools/ddms.sh to /etc/environment and run

sudo source /etc/environment

but ddms is fired from the terminal? Help will be appreciated.


Open your .bashrc file in vi or a text editor and add this line:

alias ddms='$HOME/android-sdk-linux/tools/ddms.sh'

Save the file and open a new terminal.

  • I edited .bashrc typed ddms on terminal and it says "bash: /home/gaurav/android-sdk-linux/tools/ddms.sh: No such file or directory" – Gaurav Agarwal May 22 '13 at 20:55
  • @bcbc your suggestion does not help it is still returning "No such file or directory" – Gaurav Agarwal May 22 '13 at 21:36
  • 1
    @codingcrow That was your edit. I just replaced /home/user with an environment variable that applies to any user. Unless you meant to hardcode to a user named user? If it says "no such file or directory", then that indicates that the ddms.sh script does not exist at that location. – bcbc May 22 '13 at 22:13
  • @bcbc It works without .sh in the end. – Gaurav Agarwal May 23 '13 at 16:52
  • @codingcrow Here's some more info on bash aliases: tldp.org/LDP/abs/html/aliases.html – Ed Manet May 23 '13 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.