WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline julcar

  • Jr. Member
  • **
  • Posts: 77
What are the differences between ~/.ashrc & ~/.profile ??
« on: December 03, 2020, 05: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: 1229
Re: What are the differences between ~/.ashrc & ~/.profile ??
« Reply #1 on: December 03, 2020, 06: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: 11049
Re: What are the differences between ~/.ashrc & ~/.profile ??
« Reply #2 on: December 03, 2020, 12:54:32 PM »
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.