Cannot locate pig-core-h1.jar. do 'ant jar', and try again - apache-pig

I have installed pig in my system by using following steps -
first i have downloaded pig-0.14.0.tar.gz
then i have extracted
tar xvzf /home/impadmin/Downloads/pig-0.14.0.tar.gz
sudo mv pig-0.14.0 /usr/local/pig
sudo chown -R hduser:hadoop pig
nano ~/.bashrc
then added the following lines in bashrc file
# PIG binary paths
export PIG_INSTALL="/usr/local/pig"
export PATH="${PATH}:${PIG_INSTALL}/bin"
touch ~/.pigbootup
nano /usr/local/pig/conf/pig.properties
then added the following code in pig.properties
pig.logfile=/home/hduser/hadoop/pig/logs/
after insatllation when i am executing pig version command
then its giving me error -
Cannot locate pig-core-h1.jar. do 'ant jar', and try again
there is a jar file named pig-0.14.0-core-h1.jar so i copied the same file and renamed it as pig-core-h1.jar but still its giving me the same error .
have i done anything wrong during installation?

~/.bashrc should look like this
# PIG binary paths
export PIG_INSTALL="/usr/local/pig"
export PATH="$PATH:$PIG_INSTALL/bin"
No need for the curly brackets
additionally you need to (this or reboot the machine):
$source ~/.bashrc

Related

How do I run some command every time the new terminal window is open in VS Code?

So I want to run source ~/.bashrc in VSCode terminal so I can load my own command to run on it. Right now I have to manually on the command line. Are there anyway I can run the command before the terminal start? (OS: Mac)
Since you are using macOS, the ~/.bashrc file is not used, instead it's ~/.bash_profile. You can do one of the following:
Put your custom commands in ~/.bash_profile, or
Source your ~/.bashrc from your ~/.bash_profile:
Create a file ~/.bash_profile with the following content:
source ~/.bashrc
Give the new file the same permissions as ~/.bashrc

SSH opening file error - no idea why

Running Debian Linux - newest version.
cp /included/filename /usr/bin/
It gives me error "cannot stat '/included/filename': No such file or directory
I don't get why there should be an error. I am doing it as superuser.
From your latest comment i conclude you got the paths mixed up. If you want to copy the file install.sh located under /usr/bin/included/ you would need to do
cp /usr/bin/included/install.sh /usr/bin/
to make something similar to your provided command work, id assume you are in /usr/bin and the first argument needs to be a relative one
cd /usr/bin
cp ./included/install.sh /usr/bin/
Please provide more information on what you are trying to do and provide realworld example code.

Running .sh scripts in Git Bash

I'm on a Windows machine using Git 2.7.2.windows.1 with MinGW 64.
I have a script in C:/path/to/scripts/myScript.sh.
How do I execute this script from my Git Bash instance?
It was possible to add it to the .bashrc file and then just execute the entire bashrc file.
But I want to add the script to a separate file and execute it from there.
Let's say you have a script script.sh. To run it (using Git Bash), you do the following: [a] Add a "sh-bang" line on the first line (e.g. #!/bin/bash) and then [b]:
# Use ./ (or any valid dir spec):
./script.sh
Note: chmod +x does nothing to a script's executability on Git Bash. It won't hurt to run it, but it won't accomplish anything either.
#!/usr/bin/env sh
this is how git bash knows a file is executable. chmod a+x does nothing in gitbash. (Note: any "she-bang" will work, e.g. #!/bin/bash, etc.)
If you wish to execute a script file from the git bash prompt on Windows, just precede the script file with sh
sh my_awesome_script.sh
if you are on Linux or ubuntu write ./file_name.sh
and you are on windows just write sh before file name like that sh file_name.sh
For Linux -> ./filename.sh
For Windows -> sh file_name.sh
If your running export command in your bash script the above-given solution may not export anything even if it will run the script. As an alternative for that, you can run your script using
. script.sh
Now if you try to echo your var it will be shown. Check my the result on my git bash
(coffeeapp) user (master *) capstone
$ . setup.sh
done
(coffeeapp) user (master *) capstone
$ echo $ALGORITHMS
[RS256]
(coffeeapp) user (master *) capstone
$
Check more detail in this question
I had a similar problem, but I was getting an error message
cannot execute binary file
I discovered that the filename contained non-ASCII characters. When those were fixed, the script ran fine with ./script.sh.
Once you're in the directory, just run it as ./myScript.sh
If by any chance you've changed the default open for .sh files to a text editor like I had, you can just "bash .\yourscript.sh", provided you have git bash installed and in path.
I was having two .sh scripts to start and stop the digital ocean servers that I wanted to run from the Windows 10. What I did is:
downloaded "Git for Windows" (from https://git-scm.com/download/win).
installed Git
to execute the .sh script just double-clicked the script file it started the execution of the script.
Now to run the script each time I just double-click the script
#!/bin/bash at the top of the file automatically makes the .sh file executable.
I agree the chmod does not do anything but the above line solves the problem.
you can either give the entire path in gitbash to execute it or add it in the PATH variable
export PATH=$PATH:/path/to/the/script
then you an run it from anywhere

bash sqlplus command not found

I am trying to install sqlplus on my mac following the tutorial here: https://tomeuwork.wordpress.com/2014/05/12/how-to-install-oracle-sqlplus-and-oracle-client-in-mac-os/comment-page-1/#comment-6
I have downloaded the two packages (basic and sqlplus) and created all the directories as it says, I moved the necessary files inside the directories.
I created and copied the tnsnames.ora file with the contents:
MYDB=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=*********)
(PORT=1521)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SID=MYDB-SID)
) )
And i created the .bash_profile as it says in the tutorial.
But what im stuck on is making the sqlplus run.
typing in sqlplus returns command not found.
in the tutorial it says i should use $ sqlplus username/password#database
where do i get the username and database name from?, I haven't created one yet.
Thanks in advance.
According to your article, you should do the following:
$ vi ~/.bash_profile
Add the following line to the end of the file.
alias sqlplus=’rlwrap sqlplus’
Now reload the .bash_profile:
$ source ~/.bash_profile
Looks like you missed these steps.
You can try to execute:
$rlwrap sqlplus
According to the comments below you do not have sqlplus in the $PATH.
The value of $PATH looks wrong to me: duplicates, quotes.
Option 1
Execute:
export PATH=/Applications/‌​or‌​acle/product/instantclient_64/11.2.0.4.0/bin:/usr/local/bin:/usr/bin:/bin:/us‌​r/s‌​bin:/sbin
Then execute in the same console:
$ sqlplus (or $ rlwrap sqlplus)
It will set value only for the current shell. The main idea is to have full path to the sqlplus binary in the $PATH.
Option 2
Modify ~/.bash_profile.
To save as a permanent environment variable edit ~/.bash_profile. There are some details about setting PATH in the source article.
Top down troubleshooting approach
Look for binary - use type
[bbrandt] ~/ $ type sqlplus
sqlplus is aliased to `rlwrap sqlplus'
Where is my binary.. hidden behind an alias, let's unalias
[bbrandt] ~/ $ unalias sqlplus
[bbrandt] ~/ $ type sqlplus
sqlplus is /u01/app/oracle/product/11.2.0/xe/bin/sqlplus
Found it! What happens if I modify my binary search-path?
[bbrandt] ~/ $ echo $PATH
/u01/app/oracle/product/11.2.0/xe/bin:/home/bbrandt/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin
[bbrandt] ~/ $ export PATH=/home/bbrandt/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin
Now, where is my binary?
[bbrandt] ~/ $ type sqlplus
bash: type: sqlplus: not found
[bbrandt] ~/ $
This is where you are... look in your $PATH variable

Error on terminal start

-bash: /etc/profile.d/rvm.sh: No such file or directory
-bash: /Users/janekambani/.bash_profile: line 1: conditional binary operator expected
-bash: /Users/janekambani/.bash_profile: line 1: syntax error near `"$HOME/.rvm/scripts/rvm"'
-bash: /Users/janekambani/.bash_profile: line 1: `[[ -s "$HOME/.rvm/scripts/rvm"]] && . "$HOME/.rvm/scripts/rvm" '
I tried this:
sudo rm -rf /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm /usr/local/bin/rvm $HOME/.rvm $HOME/.rvmrc
but i still kept getting the same error.
im using OS X 10.8
Take a look at the source of /etc/profile.
On 10.8 of Mac OS, installing RVM while using sudo, adds a line to /etc/profile.d/rvm.sh. Even if you remove RVM using rvm implode, that one liner stays in there and will cause that error to show on start up of any terminal.
Use your favorite text editor (nano,vim, etc) to open /etc/profile and comment out these two lines:
source /etc/profile.d/sm.sh
source /etc/profile.d/rvm.sh
Then save the file.
To fix any issues with sourcing RVM use:
rvm get stable --auto-dotfiles #OR:
rvm get head --auto-dotfiles
It will remove existing sourcing lines and add new ones that are meant to work.
This is happening due to a botched installation of RVM (at least the part that tried to install the shell loader was botched). Did you recently try to install RVM?
Something kept trying to insert the RVM load code and it has made a mess.
Here is my suggestion:
Make a backup copy of your .bash_profile.
Open it in a text editor and remove everything but:
export PATH=/Applications/SenchaSDKTools-2.0.0-Developer-Preview:$PATH
export PATH=/Applications/SenchaSDKTools-2.0.0-Developer-Preview/command:$PATH
export PATH=/Applications/SenchaSDKTools-2.0.0-Developer-Preview/jsbuilder:$PATH
Add this line below that:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Save it and open another terminal and see if the error goes away.