WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: why is ~/.ashrc executed twice?  (Read 5995 times)

Offline MJZ

  • Newbie
  • *
  • Posts: 13
why is ~/.ashrc executed twice?
« on: December 22, 2011, 08:39:32 AM »
Hi!

I use microcore (now core4.2-rc2), and I wonder, why at login ~/.ashrc is executed twice? Who calls it for a second time?

thank you!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11623
Re: why is ~/.ashrc executed twice?
« Reply #1 on: December 22, 2011, 09:46:39 AM »
Hi MJZ
Why do think it's executing twice?

Offline MJZ

  • Newbie
  • *
  • Posts: 13
Re: why is ~/.ashrc executed twice?
« Reply #2 on: December 22, 2011, 10:02:52 AM »
I added some custom commands, the run twice

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: why is ~/.ashrc executed twice?
« Reply #3 on: December 22, 2011, 11:02:21 AM »
.ashrc will run on every shell process. Perhaps your commands would be better served in .profile (once per login) or .xsession (upon start of X), or even /opt/bootlocal.sh (once per bootup backgrounded) or /opt/bootsync.sh ( once per bootup not backgrounded).
10+ Years Contributing to Linux Open Source Projects.

Offline MJZ

  • Newbie
  • *
  • Posts: 13
Re: why is ~/.ashrc executed twice?
« Reply #4 on: December 22, 2011, 11:57:13 AM »
thanks. ~/.profile would be the place to be, and I actually wanted it first time.

but oddly ~/.profile gets always overwritten with a default file at boot time.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: why is ~/.ashrc executed twice?
« Reply #5 on: December 22, 2011, 02:30:41 PM »
You have to run backup after modifying .profile or you will get the old one at next boot.

Offline MJZ

  • Newbie
  • *
  • Posts: 13
Re: why is ~/.ashrc executed twice?
« Reply #6 on: December 22, 2011, 06:05:03 PM »
as I want to have no system backup at all (and avoid the "filetool" structure for an embedded system),
can I also go with the boot options "home=sdaX" and "norestore"??
Or do those two options interfere with each other?

thanks!!

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: why is ~/.ashrc executed twice?
« Reply #7 on: December 23, 2011, 06:33:32 AM »
Yes, a persistent home is ok too.
The only barriers that can stop you are the ones you create yourself.