cannot find /usr/bin/env while running pig - cygwin

I have installed cygwin to run pig on windows. But it is showing following error.
$ pig -x local
/usr/bin/env: bash: No such file or directory

Have you add pig to your PATH ?
Could you try with the absolut path :
/Users.../pig-12.1/bin/pig -x local

Related

sbt failed to download launcher

When I am trying to run 'sbt' on terminal, it is showing like this:
downloading sbt launcher 1.5.5
cat: /home/knoldus/.cache/sbt/boot/sbt-launch/1.5.5/sbt-launch-1.5.5.jar.sha1: No such file or directory
shasum: standard input: no properly formatted SHA checksum lines found
failed to download launcher jar: https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.5.5/sbt-launch-1.5.5.jar (shasum mismatch)
i had the same error and i just move to the directory and download the file missing manualy
cd ~/.cache/sbt/boot/sbt-launch/1.5.5/
wget https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.5.5/sbt-launch-1.5.5.jar
then i run
sbt package
You need to install curl. It is used in the sbt launcher shell script to download the file sbt-launch-1.5.5.jar.sha1 mentioned in the error message. If curl is missing, that will result in the error you've observed.
SBT package downloaded from the official website includes sbt-launch.jar in <sbt-install-folder>/bin directory. SBT launcher sbt is a shell script that searches for this JAR. If the JAR is not found, it will try to download it from the internet and fail if the machine is behind a proxy.
So, when this happens, first thing is to check the sbt file location and if sbt-launch.jar is present. If the JAR is missing, it can be copied from the official SBT distribution, even if the machine is behind the proxy or offline.
The issue is apparently with command curl --output not being able to open the output file. In my /usr/bin/sbt there is a function
download_url () {
local url="$1"
local jar="$2"
mkdir -p $(dirname "$jar") && {
if command -v curl > /dev/null; then
curl -L "$url" --output "$jar"
elif command -v wget > /dev/null; then
wget -O "$jar" "$url"
fi
} && [[ -f "$jar" ]]
Changing the curl line to:
curl -L "$url" > "$jar"
Fixed the issue for me. I have no idea what the underlying problem with curl is, but it happened both when installed with apt and snap.

Windows Linux Bash bad variable name when running /bin/sh -c "$(curl -fsS https://install.airshipcms.io)"

everything was working until I changed my mobo/cpu and I'm not sure what the error message means.
After running the install command
/bin/sh -c "$(curl -fsS https://install.airshipcms.io)"
my windows ubuntu bash shell returns
Starting Airship Launcher installation for ubuntu Linux64
Will install version 2.1.1
Downloading https://install.airshipcms.io/Linux64/airship-2.1.1.tar.bz2
To /tmp/AirshipLauncher.65/airship-2.1.1.tar.bz2
Added ~/.airship-bin to $PATH in ~/.profile
/bin/sh: 504: export: (x86)/Intel/iCLS: bad variable name
My guess was that because I already had it installed pre-upgrade of the mobo/cpu the variable name is already taken in the ~/.profile ? I'm not sure how to edit it, when I ran cat ~/.profile it rendered a bunch of unreadable characters.
thank you.
edit: I've tried reinstalling my linux shell, to no avail.
Okay so the fix is to replace sh with bash so the working command was
/bin/bash -c "$(curl -fsS https://install.airshipcms.io)"
credit goes to this guy https://github.com/probonopd/PowerShell/commit/2441d99a7405b488dc9289789edb636dc2cdcdfc

My sh codes don't work, help needed

I'm learning to work with linux but it isn't working out
Script 1, did work until I updated opensuse:
#!/bin/bash
useradd Test
passwd Test123
mkhomedir_helper Test
(It now says that all these commands don't exist)
Script 2, I can only get into my MySql console and he doesn't execute everything:
#!/bin/bash
mysql -u root -ppassword
sleep 3
CREATE USER 'Test'#'localhost' IDENTIFIED BY 'password'
I would really appreciate some help here since I'm new to linux
Run following cmd:
echo $PATH
Output should be list some paths as below
/Usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
If not then run below command:
export PATH="/Usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
Now try running above script-1, if it still gives same error, then you are missing some packages, install 'pam' package which contains mkhomedir_helper binaries, so run following command to install pam.
zypper in pam
Script 2, to run mysql query from command line or as a shell script you need to use '-e' option, change the script 2 as below:
#!/bin/bash
mysql -u root -ppassword -e 'CREATE USER "Test"#"localhost" IDENTIFIED BY "password"'

Installation of Cron in cygwin

When I run the following command in cygwin,
$ cygrunsrv -I cron -p C:\cygwin64\bin --args -n
I get the following error
cygrunsrv: Given path doesn't point to a valid executable
Why am I getting this error?
You only gave a folder and not a path to the executable. Besides this I wouldn't recommend to use windows paths in cygwin, this can cause errors. You should write /cygdrive/c/cygwin64/bin/something instead of C:\cygwin64\bin\something.exe
Perhaps you are looking for an
installation guide, and you would like to do something like this:
Install cron as a windows service, using cygrunsrv:
cygrunsrv -I cron -p /usr/sbin/cron -a -D
net start cron

Saucelabs connect Linux - Not recognising the '-u' command

When trying to start up a tunnel using saucelabs connect, I'm using the standard command within the bin folder:
sc -u USERNAME -k API-KEY
However, when I run it, an error is thrown saying:
sc: invalid option -- 'u'
I've tried on windows and it runs perfectly. Any ideas why it can't read the command?
Probably there's another command in your PATH called sc. Try this:
$ cd <directory where you downloaded Sauce Connect>
$ ./sc -u <username> -k <API key>

Resources