WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Enable user profile  (Read 7692 times)

Offline cjgau

  • Newbie
  • *
  • Posts: 27
Enable user profile
« on: January 07, 2009, 01:16:31 PM »
Hi,

Hope this is the place for a newbie's question.

I like to use the aliases ll and la in the .profile, but didn't know how to enable it.

TIA, TC is a clean and wonderful distro!


Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: Enable user profile
« Reply #1 on: January 07, 2009, 01:23:04 PM »
You can set the ENV variable.  For more info, see http://forum.tinycorelinux.net/index.php?topic=196.0

Currently, aliases in .profile will be available only on a VT console.

Offline cjgau

  • Newbie
  • *
  • Posts: 27
Re: Enable user profile
« Reply #2 on: January 07, 2009, 04:16:18 PM »
Thank you, hats.

For now I just use your code "aterm -e sh --login" saved in Home directory, and double clicks from emelfn2.

Thanks again for your prompt response.

Offline florian

  • Full Member
  • ***
  • Posts: 116
    • Home Page
Re: Enable user profile
« Reply #3 on: January 07, 2009, 04:42:50 PM »
Robert and Team, I would suggest that by default TC would move its alias definition to a ~/.ashrc file and include this also from ~/.profile. This would allow to have same aliases in both the initial login shell and the non-login shells.

Here's an extract of my  ~/.profile:
Code: [Select]
if [ -n "$BASH_VERSION" ]; then
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
else
    export ENV="$HOME/.ashrc"   
    if [ -f "$HOME/.ashrc" ]; then
        . "$HOME/.ashrc"
    fi
fi

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Enable user profile
« Reply #4 on: January 07, 2009, 07:12:44 PM »
Good suggestion florian, will implement.
10+ Years Contributing to Linux Open Source Projects.

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: Enable user profile
« Reply #5 on: January 07, 2009, 07:39:55 PM »
Is checking for those bash specifics needed?  Usually the regular user profile in .bash_profile for bash is used anyways.  (perhaps the bash extension should include one if it doesn't)

Also, just to change a bit, having setting ENV inside the if statement might be better:
Code: [Select]
if [ -f "$HOME/.ashrc" ]; then
  export ENV="$HOME/.ashrc"
  . "$HOME/.ashrc"
fi

Offline florian

  • Full Member
  • ***
  • Posts: 116
    • Home Page
Re: Enable user profile
« Reply #6 on: January 08, 2009, 11:33:22 AM »
yes ^thehatsrule^, it's better how you wrote it for TC. My own .profile has bash stuff because I usually I keep only one home directory for several distros.

One more detail: i see there are by default in TC some alias for mv (to mv -i) and rm (to rm -i). For similar safety reason, I would suggest to also alias cp to cp -i.

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: Enable user profile
« Reply #7 on: January 08, 2009, 01:49:59 PM »
One more detail: i see there are by default in TC some alias for mv (to mv -i) and rm (to rm -i). For similar safety reason, I would suggest to also alias cp to cp -i.

before you do that, i'd make the existing aliases (aliasi?) do what they're intended to:

echo "" > tmpy
echo "" > tmpz
mv tmpy tmpz

does not show any presence of -i that i know of.

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: Enable user profile
« Reply #8 on: January 08, 2009, 01:57:45 PM »
One more detail: i see there are by default in TC some alias for mv (to mv -i) and rm (to rm -i). For similar safety reason, I would suggest to also alias cp to cp -i.

before you do that, i'd make the existing aliases (aliasi?) do what they're intended to:

echo "" > tmpy
echo "" > tmpz
mv tmpy tmpz

does not show any presence of -i that i know of.
See the 2nd post in this thread.

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: Enable user profile
« Reply #9 on: January 08, 2009, 02:11:36 PM »
See the 2nd post in this thread.

oic... well spotted. yes in the vt, they appear to be there. since i use the vt sometimes, i'll know i have the option for safer commands without issuing -i to them, thanks.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Enable user profile
« Reply #10 on: January 11, 2009, 02:15:09 PM »
Thanks guys. Implemented .ashrc in TC 1.1 Alias definitions now work as expected. No more need to modify .jwmrc aterm shell calls. I agree with hats, the bash part should be implemented in the bash extension.
10+ Years Contributing to Linux Open Source Projects.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Enable user profile
« Reply #11 on: January 12, 2009, 08:19:10 AM »
I will look into what needs to be done for the bash extension as for as .bash_profile is concerned and add it.