getting "bash: /etc/profile [...] No such file or directory" message when starting up a new terminal window - rvm

Last login: Wed Feb 27 22:38:32 on ttys003
-bash: /etc/profile.d/rvm.sh: No such file or directory
-bash: /etc/profile.d/sm.sh: No such file or directory
Williams-MacBook-Pro:~ william$
I think this has something to do with an rvm-installation going wrong sometime in the past, but I can't seem to fix the error that shows up everytime i open up a new terminal window.

The solution was to cd to /etc/profile and comment out the two lines that was causing trouble.

The solution for me was to cd to /etc and to modify the profile file.
The previous answer to cd /etc/profile didn't work as on my Mac, "profile" is a file and not a directory.

Related

why does terminal start with '/Users/nicholas/.zshrc:source:75: no such file or directory:' after uninstalling ohmyzsh?

i've uninstalled ohmyzsh and now everytime i start my termial it says this:
Last login: Sat Feb 6 13:53:16 on ttys001
/Users/nicholas/.zshrc:source:75: no such file or directory: /Users/nicholas/.oh-my-zsh/oh-my-zsh.sh
nicholas#macbook ~%
How to fix it?
(original screenshot here)
open .zshrc
If you can't find find .zshrc, then type "ls -a" in terminal to get hidden files
After opening .zshrc file, comment the line 75 by appending "#"
First you need to open the terminal on your mac.
Then type "ls -a" now you can see all .zsh files on your macOS
Delete .zsh file using this command "rm .zsh" then hit the enter.
move source $ZSH/oh-my-zsh.sh after the path variable. So it looks like below. save and reopen terminal.
export ZSH="/Users/<username>/.oh-my-zsh"
export PATH=$HOME/bin:/usr/local/bin:$ZSH:$PATH
source $ZSH/oh-my-zsh.sh

Ubuntu 18 Autocomplete Bug? "bash: cd: too many arguments"

Autocomplete started working bad after upgrading from ubuntu 16. If I hit tab after
git checkout src/
I get something like this:
$ git checkout src/bash: cd: too many arguments
main/ test/
Coincidentally I happened to see the same using the "test" command of gnu-coreutils:
$ ls
pom.xml src target
$ test pom.xml
bash: cd: too many arguments
Are the two things maybe connected? Unfortunately I couldn't find any bug after googling it.
I had the same issue. One of my aliases had the name test, lib or root (I don't remember which one) and it was a cd command to a folder. Renaming the alias solved the problem for me.
My latest alias with .bashrc was with using words like test and git where I was trying to change to corresponding directories. I have changed them to testdir and gitdir and restarted my computer. I don't have this -bash: cd: too many arguments error showing up now.

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

Shell script invocation error - deleted Fabric framework remains in project

I've added Fabric/Crashlytics framework into my project manually (not via Cocoapods) before, and then deleted both manually too. This error showed up at the compile time:
/Users/myUserName/Library/Developer/Xcode/DerivedData/ProjectName-hgnmlcwlcxdbmqdzjjegfjbdmxsy/Build/Intermediates/ProjectName.build/Debug-iphonesimulator/ProjectName.build/Script-800A33631A8B53890076A7E8.sh: line 2: ./Fabric.framework/run: No such file or directory
I found the .sh file in the path and tried to delete it, but that file got generated automatically every time I run the project:
Please help me fix this hour burner...
Here's the entire error message if needed: dropbox link
This still happens in
[Crashlytics] Version 3.7.0 (102).
You have to change file permissions for both the script
chmod 755 ./YourApp/SDK/Fabric/Fabric.framework/run
and the executable
chmod 755 /YourApp/SDK/Fabric/Fabric.framework/uploadDSYM
If the script doesn't need to be executed (which I'm guessing since you tried to delete it). You can always try this workaround:
$ script="/Users/myUserName/Library/Developer/Xcode/DerivedData/ProjectName-hgnmlcwlcxdbmqdzjjegfjbdmxsy/Build/Intermediates/ProjectName.build/Debug-iphonesimulator/ProjectName.build/Script-800A33631A8B53890076A7E8.sh"
$ awk 'NR==2 { print "exit 0;" } { print }' "$script" > .tmp && mv .tmp "$script"
Which adds an exit between the first and second line of the script. If the file gets regenerated you can also work around that by changing permissions:
$ sudo chmod 111 "$script"
This way the file should be protected from being overwritten or re-created.
Hope this helps:
Step : 1 : open your path (/Users/myUserName/Library/Developer/Xcode/DerivedData/ProjectName-hgnmlcwlcxdbmq‌​dzjjegfjbdmxsy/Build/Intermediates/ProjectName.build/Debug-iphonesimulator/Projec‌​tName.build/Script-800A33631A8B53890076A7E8.sh) with go to folder from finder.
Step : 2 : There open your "Script-800A33631A8B53890076A7E8.sh" file
Step : 3 : Modify .sh file as shown below
#!/bin/sh
exit 0; chmod 111 //add this after building has started and save
./Fabric.framework/run <FABRIC API KEY> <FABRIC API SECRET>