Reply
Thread Tools
Posts: 139 | Thanked: 32 times | Joined on May 2008 @ France
#1
Hi,

I'm a beginner in command line and I'm a bit lost with Maemo's shell : I'd like to create basic aliases for my N900 (alias ll = 'ls -l', that kind of stuff).
Apparently the default shell doesn't have a .bashrc, so I don't know where to put my aliases.
How to apply the changes afterwards, too ? (sounds like there isn't "source" either)

Thanks
 
Posts: 486 | Thanked: 251 times | Joined on Oct 2009
#2
Originally Posted by choubbi View Post
Hi,

I'm a beginner in command line and I'm a bit lost with Maemo's shell : I'd like to create basic aliases for my N900 (alias ll = 'ls -l', that kind of stuff).
Apparently the default shell doesn't have a .bashrc, so I don't know where to put my aliases.
How to apply the changes afterwards, too ? (sounds like there isn't "source" either)

Thanks
The n900 does not come with bash, but with a much simpler sh compatible shell.

In a terminal, type:
Code:
echo 'alias ll="ls -l"' > /home/user/.profile
You can then type:
Code:
source /home/user/.profile
The source will work. I don't know what your problem was. From then on, opening a new terminal will atomatically read the commands in .profile and the source command not needed.
 

The Following 5 Users Say Thank You to j.s For This Useful Post:
Posts: 139 | Thanked: 32 times | Joined on May 2008 @ France
#3
Thanks, it works !
I had found a thread in which it was told .profile was supposed to be an equivalent to .bashrc (I wasn't sure it worked for aliases though), but I couldn't source it with "source .profile". "source /home/user/.profile" works though, I guess it was just the path that was required (I just tested with ./.profile, it works too).
 
Posts: 393 | Thanked: 67 times | Joined on Feb 2010
#4
The above instructions seem like they only apply to the current xterm session, all new sessions need "source /home/user/.profile" run each time to see all aliases.

Does anyone have any ideas?
 
Posts: 5,795 | Thanked: 3,151 times | Joined on Feb 2007 @ Agoura Hills Calif
#5
I prefer to use vi to create the file, but it seemed to work for me.

You could also use leafpad if you have it installed.


You would go to the /home/user directory

You would type vi .profile and hit enter

after the vi editor opened you would type the letter i

then you would type the alias line you wanted

then you would type the esc key

then you would type :wq and hit enter

then you would be thru. close the xterm, reopen it and see if it works.

Last edited by geneven; 2010-04-22 at 19:19.
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#6
Originally Posted by mail_e36 View Post
The above instructions seem like they only apply to the current xterm session, all new sessions need "source /home/user/.profile" run each time to see all aliases.

Does anyone have any ideas?
The .profile script should be read automatically by every new session. The "source /home/user/.profile" is only needed if you've edited the file since launching the session and want to load the updates.
 

The Following User Says Thank You to Rob1n For This Useful Post:
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#7
Warning: a bogus .profile can render the device non-bootable so be very very careful when editing it, and make sure you have a recent backup in case you need to reflash.
 

The Following 3 Users Say Thank You to lma For This Useful Post:
PMaff's Avatar
Posts: 361 | Thanked: 219 times | Joined on Sep 2010
#8
Originally Posted by lma View Post
Warning: a bogus .profile can render the device non-bootable so be very very careful when editing it, and make sure you have a recent backup in case you need to reflash.
It would be a good idea to mark such warnings somehow in
talk maemo...
Thanks again.
 
Posts: 166 | Thanked: 30 times | Joined on Apr 2010 @ Halifax, UK
#9
Originally Posted by lma View Post
Warning: a bogus .profile can render the device non-bootable so be very very careful when editing it, and make sure you have a recent backup in case you need to reflash.
how so??? .profile is empty to begin with and if you edit root/.profile all you are doing is adding a line of alias - if you delete its contents it still boots
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:51.