Cocoa installation: terminal showing 'Is a directory' error while getting POD file - swift

I am always getting the same error i.e. is a directory when I try to execute the above bash script in the terminal to get pod file.
What can I do?
Thanks

In the first couple lines, you appear to have an errant filepath in your command. Instead of $ /Users/rgf...TestTable.xcodeproj cd, it should have been $ cd. Your shell is complaining because the command–as you've written it–appears to be executing a directory, which isn't possible.

Related

How to execute custom fish scripts in custom path folder

I'm having trouble executing a fish shell script I created. I added it to a custom path I added using fish_add_path. The folder appears just fine in $fish_user_paths and $PATH, and i've CHMOD +x the file, but when I type the name of the file, (which is pickc ath the moment), it can't find the command. How do I add fish scripts to the path and execute them like any other cli command (e.g. pickc)?
The content of the script is:
#!usr/bin/fish
colorpicker --short --one-shot --preview | sed -z 's/\n//g' | xclip -selection c
pkill picom
picom -b
I can execute the script just fine with the fish -c pickc command, but I can't execute with ./pickc, which gives me the error
Failed to execute process './pickc'. Reason: The file './pickc' does not exist or could not be executed.
I have doubly confirmed that the path in the $PATH and $fish_user_variable variable does lead to the folder containing the script.
Edit: I noticed that my paths were all really messed up somehow. The below answer does fix the issue of not being able to execute it, so thanks
You have mistyped your shebang. Switch
#!usr/bin/fish
to
#!/usr/bin/fish
or whatever path which fish shows.

Nagios Error : /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

I am trying to install nagios-plugins-2.2.1 on redhat machine
when running this command:
Nagios /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
i am getting the error as
no such file or directory
pls help
https://www.youtube.com/watch?v=VsIrAsXzbx4
It looks like the nagios binary is located in another location not in /usr/local/nagios/bin/nagios
To find where it is run:
which nagios
If nagios was installed using the RHEL package manager so it will be usually in:
/usr/sbin/nagios
If it did not come back with result just type the first 3 letters "nag" then type the "Tab" key and it will complete it.
Once you find it then use it instead of /usr/local/nagios/bin/nagios
Then make sure you get the right nagios.cfg file location by running the 2 following commands:
updatedb
locate nagios.cfg
If when you run updatedb you got "Command not found" error message then mlocate package is not installed and you can get the nagios.cfg location by running this command instead
find / -xdev -type f -name "nagios.cfg"
So by that you should have both "nagios binary" and "nagios.cfg file", you can then re-run the command with the right file paths
It looks like "nagios.cfg" does not exist.
Try to create it and configuring it manually.
Then try again.
You can try to look at where your nagios.cfg file has been created, using
locate nagios.cfg
for instance, to make sure your file is in the right path and maybe call that newly displayed path instead.
/usr/local/nagios/bin/nagios -v [path_of_nagios_cfg]
Also you need to omit the first "Nagios" from the command line as it is in Capital N which sure is supposed to come back with "no such file or directory" message
The command should only be like this:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
you will find nagios.cfg file in #/usr/local/nagios/etc
then run that command giving this path.

second line on my system or python terminal now saying: “ -bash: zzzzz#: command not found“

I have been trying to pip install psycopg2 for some time now
I have just updated to python 3.7.4, before this problem started.
To set my path to a specific python version I used the code below.
nano .bash_profile
I thought that it would now be easy for my system to identify the path of the newly installed python, as to enable it to install psycopg2. Then the below started happening.
The second line of system terminal or python terminal is now always showing:
-bash: zzzzz#: command not found on my terminal
No matter what I type on my terminal, I am always getting command not found
This would mean you literally have "zzzzz" somewhere in the bash_profile. Bash is seeing "zzzzz" as just another command to run at startup like the rest of the profile script. As there is nothing in your PATH matching that string, bash reports the issue back to you.
Either remove the extra line from your .bash_profile. OR use a terribly wasteful work-around!
ln -s /bin/true /bin/zzzzz
This will create a symbolic link to the "true" binary (all it ever does is return true) from zzzzz. Now bash can find zzzzz and run it during start up, which does nothing. No more error and an absurd work around. You should fix the file.

Opening emacsclient in terminal works but won't work with Automator

So I'm getting some pretty strange behaviour when I try to use an Automator service to open new emacs (GNU Version 25.2 with spacemacs) buffers.
In my terminal, the command emacsclient -a '' -c works as expected, opening a new buffer through emacsclient. However, when I make a service in Automator which simply runs a (/bin/bash) shell script:
emacsclient -a '' -c
I get an error message:
The action “Run Shell Script” encountered an error: “emacsclient: could not get terminal name”
On suspicions that this was due to Automator not using some default PATH variable, I tried the following instead:
PATH=/usr/local/bin:$PATH
emacsclient -c
which produced the same error as before.
Next I tried
PATH=/usr/bin:/usr/local/bin export PATH;
emacsclient -c
which produced a different error message:
The action “Run Shell Script” encountered an error: “emacsclient: invalid option -- c
Try `emacsclient --help' for more information”
however why I try that script in my terminal it also gives a similar error which doesn't make much sense to me.
If anyone has suggestions for how to fix this I'd really appreciate it.
The problem is the shell script is running an old version of emacsclient in /usr/bin you need to run the one in Emacs.app/Contents/MacOS/bin/emacsclient. Delete the PATH line and you can use a solution listed here for running emacsclient inside automator Running a macOS service for open with emacs failed with "emacsclient: could not get terminal name mac"

Running Executable from Shell Script

I am having trouble launching an executable that I have created from a shell script. I would like to automate testing by running the program many times with different command line options to verify it is working.
When I type echo $SHELL, /bin/sh is displayed.
The following is my shell script:
#!/bin/sh
clear
echo "Running first test."
./myProgram
exit 0
When I run the script (sh myScript.sh), with myProgram in the same directory, I see the following output:
Running first test.
: not foundsh: line 4:
When executing the program ./myProgram, it runs as expected with no command line options.
I have also tried:
myProgram
./myProgram &
myProgram &
based on answers to somewhat similar questions, but they all result in the above error message.
Your newlines are goofed. Use dos2unix to fix.
why don't you try using the full path?
e.g., if myProgram is in /home/user1/bin, you can try /home/user1/bin/myProgram instead of ./myProgram. This should work.
You can also add the path to path variable, $PATH and directly call myProgram from anywhere.
Run "export PATH=$PATH:/home/user1/bin" on your terminal without the quotes. Note that this affects only your current termial session. If you want to permanently add the path, update your .bashrc file in your home directory with the following line: