1

Trying to skill up in Linux. I have written a bash script to google search from the terminal. It works adequately an I run it by typing

~/WHAT. So far so good. I can also run it using ./WHAT.

I then edit the bashrc file and add this at the end

alias < WHAT >='./WHAT'

But then when I run

source ~/.bashrc

I get the error

=./WHAT: No such file or directory

Where have have I gone wrong? Thanks in advance for your help!

4
  • 2
    Show us the text verbatim please: obfuscations like < THE ALIAS NAME > are unhelpful here Jul 17, 2017 at 17:10
  • what is FILENAME and THE ALIAS NAME? I could help if you would describe these
    – Camden
    Jul 17, 2017 at 17:14
  • 1
    IMHO your objective would be better achieved by placing your script somewhere like ~/bin and simply making sure that $HOME/bin is added to your PATH Jul 17, 2017 at 17:20
  • Use the full path in bash scripts. ~ and ./ are ambiguous. Also, if you place the script in ~/bin you do not even need an alias as it will be in your path.
    – Panther
    Jul 17, 2017 at 17:47

1 Answer 1

4

If you really added

alias < WHAT >='./WHAT'

you're misunderstanding Bash syntax. Read and re-read man bash. What you want is probably

alias WHAT='./WHAT'

but that's not what you want at all. See my answer over here

3
  • your link is hthttps:// should'nt it be https://
    – Camden
    Jul 17, 2017 at 17:24
  • 1
    @Camden Thank you very much. I fixed the typo. I must remember to test links before posting them.
    – waltinator
    Jul 17, 2017 at 17:26
  • @crissixpaul Then please Accept my answer, so I can get more reputation points, and, eventually, Rule The World. TQ
    – waltinator
    Jul 17, 2017 at 21:41

You must log in to answer this question.

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