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!

crissixpaul
  • 138
  • 1
  • 8
  • 2
    Show us the text verbatim please: obfuscations like < THE ALIAS NAME > are unhelpful here – steeldriver Jul 17 '17 at 17:10
  • what is FILENAME and THE ALIAS NAME? I could help if you would describe these – Camden Jul 17 '17 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 – steeldriver Jul 17 '17 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 '17 at 17:47

1 Answers1

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

waltinator
  • 36,399