-4

I have installed Pig. But when I am running command to check pig version. It is saying invalid option. I have edited bashrc file.

After doing source .bashrc I am getting following error:

hduser@ubuntu:~$ source .bashrc
bash: export: '=': not a valid identifier
bash: export: '/usr/local/pig': not a valid identifier
bash: export: '=': not a valid identifier
bash: export: 'PATH:/usr/local/pig/bin': not a valid identifier
bash: export: '=': not a valid identifier
bash: export: '/usr/local/hadoop/conf': not a valid identifier
Hywel Rees
  • 884
  • 1
  • 15
  • 22
Sachit Murarka
  • 137
  • 2
  • 12
  • @KenWhite: I am beginner and I have tried every possible means, I couldn't succeed that's why I posted it here. – Sachit Murarka Mar 04 '17 at 07:21
  • 1
    I see nothing about *every possible means* in your question, and I see nothing that explains what *I couldn't succeed* means. This site is for **specific questions** about **actual problems**. There is nothing **specific** about *I downloaded this thing but it doesn't work.* – Ken White Mar 04 '17 at 07:25
  • I had put complete problem in the question, but it was not allowing me to post my question. Anyways, I would be highly thankful if you can check it. I have extracted tar file at location /usr/local/pig-0.15.0 export PIG_HOME = /usr/local/pig-0.15.0 export PATH =$PIG_HOME/bin:$PATH export PIG_CLASSPATH = $HADOOP_HOME/conf There are 2 forms of downloads available. pig-0.15.0.tar.gz and pig-0.15.0-src.tar.gz I have tried both. – Sachit Murarka Mar 04 '17 at 07:32
  • Download only the binary `pig-0.15.0.tar.gz`. And you seemed to have spaces around `=` in the `export` statements. – franklinsijo Mar 04 '17 at 10:41
  • @franklinsijo: I have removed spaces. Now it is not allowing me to run any command on bash. Even when I run ls command it is saying: bash: ls: No such file or directory – Sachit Murarka Mar 04 '17 at 11:34
  • Your `$PATH` variable is messed up. Open `~/.bashrc`, fix the value and save it. Open a new session then. – franklinsijo Mar 04 '17 at 11:37
  • @franklinsijo: hduser@ubuntu:~$ ~/.bashrc bash: /home/hduser/.bashrc: Permission denied Then I tried this, it is not working :( http://stackoverflow.com/questions/19742005/bashrc-permission-denied – Sachit Murarka Mar 04 '17 at 11:42
  • No such file or directory – Sachit Murarka Mar 04 '17 at 11:45

1 Answers1

0

The export statements added to the .bashrc file should not contain whitespaces around =

Edit ~/.bashrc, since the $PATH variable is unset, use absolute paths for the executables.

/usr/bin/vi ~/.bashrc

Add these lines for Pig (taken from the comments) to the bashrc file,

export PIG_HOME=/usr/local/pig-0.15.0
export PATH=$PIG_HOME/bin:$PATH
franklinsijo
  • 17,784
  • 4
  • 45
  • 63