1

I know this has been a common problem but the answers provided to other questions haven't helped with my current issue.

When trying to run a file called srf2obj I get the "command not found" response.

I can see that the file is there. "file srf2obj" returns: GNU awk script, ASCII text executable

OS is installed on Virtualbox.

Any help would be great, thanks.

3
  • 1
    What answers have you tried? Aug 15, 2014 at 23:24
  • You may need to install the package "build-essential" on Ubuntu. It includes everything you need to compile and make.
    – user316157
    Aug 15, 2014 at 23:29
  • 2
    Make sure it's executable, and then run it like this: ./srf2obj Aug 16, 2014 at 0:01

1 Answer 1

4

When you type srf2obj, the shell checks to see if srf2obj is an alias, a shell function, or (this is what you want to happen) an executable file in one of the directories in your $PATH, or, if you specify a path to the file (/home/walt/bin/foo, ./srf2obj) it will try that.

If ls -l srf2obj shows that it is executable, try typing ./srf2obj. If not, make it executable via chmod +x srf2obj. If you are going to do this a lot, consider adding this directory to your $PATH.

Or, you could invoke the interpreter directly, thusly: gawk srf2obj

2
  • It is common that Linux does not check if the file resists in the current directory?
    – hfrmobile
    Dec 30, 2016 at 13:58
  • No, it's avoiding a security vulnerability. "luser: Hey root, cd to my home directory - something strange...". root:cd /home/luser;ls - if . is in $PATH, and luser has an executable version of a file called ls in the current directory, luser wins, root loses.
    – waltinator
    Dec 27, 2017 at 17:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .