WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: What are the differences between ~/.ashrc & ~/.profile ??  (Read 3902 times)

Offline julcar

  • Jr. Member
  • **
  • Posts: 77
What are the differences between ~/.ashrc & ~/.profile ??
« on: December 03, 2020, 02:02:56 AM »
Hi all,

I am using Core (not gui), and I want to export a couple of variables at boot time, but looks like using bootlocal.sh is a short but not the proper way to do it.

I am using these bootcodes:

Code: [Select]
norestore tce=sda1 home=sda1 opt=sda1
In /home/tc I can see two files that seems to be init scripts: .ashrc and .profile but I never touched them, so I would like to know what are the differences between both and which would be the best option for my needing.

Thanks.

Offline hiro

  • Hero Member
  • *****
  • Posts: 1228
Re: What are the differences between ~/.ashrc & ~/.profile ??
« Reply #1 on: December 03, 2020, 03:22:59 AM »
.profile is included regardless of which shell you are using, .ashrc is only read by the ash shell (from busybox). for example if you use bash .ashrc will not be read at all.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10979
Re: What are the differences between ~/.ashrc & ~/.profile ??
« Reply #2 on: December 03, 2020, 09:54:32 AM »
The other part is "when". .(b)ashrc is run on every shell, while .profile is run on login. This doesn't matter for exported variables, but for commands it does.
The only barriers that can stop you are the ones you create yourself.