Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: cjgau on January 07, 2009, 10:16:31 AM

Title: Enable user profile
Post by: cjgau on January 07, 2009, 10:16:31 AM
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!

Title: Re: Enable user profile
Post by: ^thehatsrule^ on January 07, 2009, 10:23:04 AM
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.
Title: Re: Enable user profile
Post by: cjgau on January 07, 2009, 01: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.
Title: Re: Enable user profile
Post by: florian on January 07, 2009, 01: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
Title: Re: Enable user profile
Post by: roberts on January 07, 2009, 04:12:44 PM
Good suggestion florian, will implement.
Title: Re: Enable user profile
Post by: ^thehatsrule^ on January 07, 2009, 04: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
Title: Re: Enable user profile
Post by: florian on January 08, 2009, 08: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.
Title: Re: Enable user profile
Post by: tobiaus on January 08, 2009, 10:49:59 AM
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.
Title: Re: Enable user profile
Post by: ^thehatsrule^ on January 08, 2009, 10:57:45 AM
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.
Title: Re: Enable user profile
Post by: tobiaus on January 08, 2009, 11:11:36 AM
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.
Title: Re: Enable user profile
Post by: roberts on January 11, 2009, 11:15:09 AM
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.
Title: Re: Enable user profile
Post by: Jason W on January 12, 2009, 05: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.