Installation difficulty; Cannot add apportable sdk bin directory into path - apportable

I am attempting to install Apportable, and I am currently attempting to add the apportable sdk bin directory into the path. Like the sample app instruction video says, I copy and paste this: "(echo; echo 'PATH="/Users/testuser/.apportable/SDK/bin:$PATH"') >> ~/.bash_profile; source ~/.bash_profile" into terminal, but I keep getting this error message: "-bash: "/Users/testuser/.bash_profile: Permission denied"
I am not sure how to proceed, or what I'm doing wrong. Any advice that you can provide would be greatly appreciated.
Thanks

It's strange that you don't have write permission to your own .bash_profile.
Here's something to try -
save the original .bash_profile
cp /Users/testuser/.bash_profile /Users/testuser/.bash_profile-save
change the permissions
chmod +w .bash_profile
update the path
(echo; echo 'PATH="/Users/testuser/.apportable/SDK/bin:$PATH"') >> ~/.bash_profile; source ~/.bash_profile

Related

-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory #10

I have no 'sudo' privilege.
When I run
printf '\n%s\n%s\n%s' '# virtualenv' 'export WORKON_HOME=~/virtualenvs'
'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bashrc
it shows error:
-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
how to solve this problem? Can anyone give some advises?
Without sudo or any other way to raise privileges you don't have write access to /usr/local/bin/ so you cannot install virtualenvwrapper.sh there. Download a distribution, extract it and copy virtualenvwrapper.sh to a directory where you have write access. Edit your .bashrc to source virtualenvwrapper.sh from that directory.
I had a similar issue because pip installed virutalenvwrapper into ~/.local.
You can change its path in .bashrc:
source $HOME/.local/bin/virtualenvwrapper.sh

CentOS 6.7 Root user home deleted?

Some how I managed to delete the /root directory, so I went and recreated and set the proper permissions to the file directory. However, my command line is different and instead of showing root#my-machine# I get -bash-4.1#.
How can I fix this?
Thanks
So you deleted /root and now you have -bash-4.1# in your command line huh?
Well this is caused of a missing / corrupt .bashrc (in your case missing) file in /root (.bashrc sources /etc/bashrc which is what sets the prompt). To fix it, you will run the following command which runs when an account is created. Run as the root user (since it is the user having the problem) or you can define the destination path.
command: (make sure you are in /root)
cp -v /etc/skel/.bash* ~/
Exit terminal and log back in.
I was able to fix the error by creating a new .bashrc
Because the /root directory was removed the default .bashrc was deleted.
I fixed it by running
/bin/cp /etc/skel/.bashrc ~/
and then sourcing the new .bashrc file with source ~/.bashrc

How can I use a dot file in a bash script unix

I am trying to install git's autocomplete (and I do not want to use Homebrew to do this), so I placed the following in my bash_profile
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
fi
The .git-completion.bash is an install script I donwload from github, specifically:
https://github.com/git/git/raw/master/contrib/completion/git-completion.bash
The .git-completion.bash file exists, I can see it when I run ls -la however, every time I open a terminal window, I see
-bash: /Users/Username/git-completion.bash: No such file or directory
(I do not know why it does not have a "." in that error)
I would appreciate any guidance on how to fix this without homebrew. Thanks

Virtualenv: workon command not found

I have installed virtualenv and the virtualwrapper via apt-get, I got to a point where I created a virtual enviroment but however later on during that same day when I used the workon command it was not found. I further on went and inspected my home directory and .virtualenvs dir and the virtualenv I created earlier were still there.
Solving this problem took two steps:
Add this to your .bashrc / .bash_profile / .zshrc:
# load virtualenvwrapper for python (after custom PATHs)
venvwrap="virtualenvwrapper.sh"
/usr/bin/which -s $venvwrap
if [ $? -eq 0 ]; then
venvwrap=`/usr/bin/which $venvwrap`
source $venvwrap
fi
Then use:
source .bash_profile
# or .bashrc / .zshrc
to reflect the changes.
Additionally, if the terminal still sometimes cant find workon, use source .bash_profile to reset and find it again.
type source .profile in home directory from terminal.
Read the readme in the top of which virtualenvwrapper.sh
You need to source it inside bashrc
open ~/.profile
cd ~
nano .profile
add at the end
#virtualenvwrapper setup
export WORKON_HOME=$HOME/envs
export PROJECT_HOME=$HOME/dev
source /usr/local/bin/virtualenvwrapper.sh
to load your .profile file you just edited:
$ . .profile
I ran in to this problem too and I simply needed to logout and log back in.
This read in the changes which the debian package manager made to my system at /etc/bash_completion.d/virtualenvwrapper

cd Desktop gives an error no such file/ directory in terminal

In Terminal, on mac, when i use the cd Desktop to view files through the terminal i get an error "no such file or directory"
When i checked the current working directory, it shows I'm in /home/
I do not understand why suddenly it doesn't work.
I tried using a .profile file to have some alias and path change. Could this change in .profile file cause this error?
Try use cd (with no parameters) for jump to your home directory which should be /Users/username. Then use cd Desktop. Alternatively you can do "cd ~/Desktop"
First of all, make a desktop folder in the home folder, then open the command prompt
Also, try the " cd desktop " command you will not get an error. Always remember the case-sensitive words before running Command.

Resources