Saturday, May 18, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 16231  / 3 Years ago, thu, june 24, 2021, 8:52:45

After I edited my ~/.profile via vi command, couldn't get out of it successfully.



So I closed the terminal and when I tried it again after reopening terminal, it showed duplicate file named ~/.profile.swp. So I deleted it.



Now it shows



bash: /home/rathin/.profile:: No such file or directory


when I try



source ~/.profile


It also shows error



Error loading /home/user/.profile no such file or directory found.


when I restart my laptop.



This is the output of vi ~/.profile



~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

"~/.profile" 25 lines, 677 characters


Any help will be much appreciated.


More From » bash

 Answers
6

Get rid of the first line in that file. It reads



~/.profile: ...


and bash tries to execute this file, the name of which ends with a :. That file does not exist, so bash complains, note the double: in the error messsge.


[#18936] Saturday, June 26, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
disdry

Total Points: 133
Total Questions: 128
Total Answers: 109

Location: Greenland
Member since Fri, Jul 31, 2020
4 Years ago
;