Sponsored Content
Operating Systems OS X (Apple) A system deletes my .bashrc file Post 302976997 by scrutinizerix on Sunday 10th of July 2016 04:12:32 PM
Old 07-10-2016
Quote:
Originally Posted by RudiC
So you say that .bashrc IS executed during login but then disappears during your interactive session?

Not quite. To represent the situation schematically the issue looks smth like this:

1.
Code:
.bashrc

normally is executed every time I open new Terminal window or start a new Terminal session (by typing the command
Code:
./.bashrc

in Terminal Preferences where you can customize what command for Terminal to execute on starting a session). I can't tell the exact moment it disappears but MOST of the time (except when it's being deleted) during my interactive session I'm able to use commands put in there successfully.

2. It also sits in its location immutably undergoing numerous shutdowns, reboots and so on.

3. At some point coinciding with some reboot (or with turning my Mac on) on Terminal trying to execute
Code:
./.bashrc

it fails because it tells
Code:
MacBook-Pro-ILJA:~ iljashebalin$ . ./.bashrc
-bash: ./.bashrc: No such file or directory

when I start Terminal session/open a new Terminal window. Executing the command
Code:
ls -lahG

reveals it's gone forever.

BTW, it was the second time I detected such misbehavior. The first time I had manually recreate the file together with all configurations I laboriously put into it.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

.bashrc file is an initialization file run by each interactive invocation

I search the web and found the following statements ..... The /etc/profile file is a system wide initialization script which is run at login time for each user, while .profile is the users own login initialization. The .bashrc file is an initialization file run by each interactive invocation... (1 Reply)
Discussion started by: cy163
1 Replies

2. Shell Programming and Scripting

Can I modify the .bashrc file instead of .profile file to customize my login?

Hello, I got this question which tells me to customize my login script. Some people in the forums suggested to modify the .profile file in my home directory. I did so, but none of my customizations show up when I open the terminal after. So, I tried to modify other files in my home directory,... (1 Reply)
Discussion started by: Hyunkel
1 Replies

3. Shell Programming and Scripting

how do i look for my .bashrc file

hi i am using cygwin and would like to modify my .bashrc file. How can search to find where it is? I have looked at multiple bashrc file in /etc but none of them seemed to work..thanks (12 Replies)
Discussion started by: npatwardhan
12 Replies

4. Shell Programming and Scripting

.bashrc file

Hi experts, I am using bash shell and I cant find any .bashrc file in my home dir. Can anybody please help me out here.... If .bashrc file is not there, from where my shell config operates? Also I want to set my prompt like... $ Please advice. (5 Replies)
Discussion started by: gentleDean
5 Replies

5. Shell Programming and Scripting

A script that deletes files.

I want to write a script that deletes files inside the dir. However, the script should also allow the user to confirm by pressing (d) key before deleting files.. #!/bin/bash for file in $1/* do size='ls -l $file | cut -f 5 -d " "' name='ls -l $file | cut -f 9 -d " "' ... (1 Reply)
Discussion started by: herberwz
1 Replies

6. Shell Programming and Scripting

Why sed command deletes last line in a file if no carriage return?

Hi I am using sed command to make SCORE=somevalue to SCORE=blank in a file. Please see the attached lastline.txt file. After executing the below command on the file, it removes the last line. cat lastline.txt | sed 's/SCORE=.*$/SCORE=/g' > newfile.txt Why does sed command remove the... (3 Replies)
Discussion started by: ashok.k
3 Replies

7. Slackware

Thunderbird 3.1.9 deletes from drafts

I am using Tbird as it came with Slackware 13.37 and everytime I send something I get a message 1 or 2 drafts deleted. Should it be doing that? If not has this been reported ? How can I find out if it was reported? I have no drafts to delete. (2 Replies)
Discussion started by: slak0
2 Replies

8. Solaris

rm -rf not able deletes file but not the directory

i am trying to remove a directory using rm -rf command but its not getting removed.. it doesnt throw any error also.. i am logging as the owner of the dir and removing it but still no luck.. i am able remove a file but not a directory. i am using solaris 10 (12 Replies)
Discussion started by: chidori
12 Replies

9. UNIX for Dummies Questions & Answers

Bashrc File - Conditional Command Execution?

Hello All, I was wondering if there is a way to execute a command in my ".bashrc" file based on how I logged into the PC? I was thinking maybe there is a way to check how the user (*myself) logged in, maybe somehow with the who command along with something else, but I'm not sure... I know I... (7 Replies)
Discussion started by: mrm5102
7 Replies
GO2(1)																	    GO2(1)

NAME
go2 - directory finder SYNOPSIS
go2 [-h] [--cd] [-i] [-r] [--setup] [--version] [pattern [pattern ...]] DESCRIPTION
This manual page documents briefly the go2 command. This manual page was written for the Debian(TM) distribution because the original program does not have a manual page. go2 is a program that finds (and changes to) directories. IMPORTANT
go2 requires be loaded from the shell. To do this include the next sentence in your $HOME/.bashrc file: [ -e /usr/lib/go2/go2.sh ] && source /usr/lib/go2/go2.sh If your wish improve directory caching, you may include also the next sentence: alias cd='go2 --cd' Both are made by the setup process the first time you invoke go2. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes ('-'). A summary of options is included below. For a complete description, see the Info files. --cd Just change working directory -i Case insensitive. -r Search from root directory. -d Search in hidden directories. -l List only, print matches and exists. --setup Install go2 in your .bashrc. SEE ALSO
This program is fully documented in http://arco.esi.uclm.es/~david.villa/go2.html COPYRIGHT
Copyright (C) 2011 David Villa This manual page was written for the Debian system (and may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. AUTHOR
David.Villa@uclm.es 2011-08-05 GO2(1)
All times are GMT -4. The time now is 03:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy