adding bash alias

adding bash alias

Postby firwareslut » Mon Jan 13, 2014 7:46 am

I would like to add the alias

alias ll='ls -alF'

to my environment but am unsure where i should set this.
firwareslut
Donator VIP
Donator VIP
 
Posts: 202
Joined: Thu Oct 06, 2011 11:53 am

Re: adding bash alias

Postby Jocko » Mon Jan 13, 2014 9:57 am

Hi firwareslut,

I think the best way is to add your alias command in the file 'profile' (in /etc).

As this file is edited at each boot to create the RSYNC-SSH environment variable, I advice you to put your line before the umask command
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: adding bash alias

Postby firwareslut » Mon Jan 13, 2014 10:08 am

Thanks!
firwareslut
Donator VIP
Donator VIP
 
Posts: 202
Joined: Thu Oct 06, 2011 11:53 am

Re: adding bash alias

Postby firwareslut » Sun Apr 13, 2014 8:28 am

Can you add this alias to the offical firmware. It's a faily standard alias in the linux world and it's a bit annoying to keep having to renter it into the profile after an update :D
firwareslut
Donator VIP
Donator VIP
 
Posts: 202
Joined: Thu Oct 06, 2011 11:53 am

Re: adding bash alias

Postby Jocko » Sun Apr 13, 2014 9:00 am

Hi firwareslut,

Why not but rather than adding directly your alias, I prefer create a file in rw_fs (e.g. myalias) and when the boot script set the profile file in /etc, it will add in the same time the alias found of myalias.

Note: with this way, your alias won't be remove at each firmware upgrading :-D

Good sunday
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: adding bash alias

Postby Jocko » Sun Apr 13, 2014 11:45 am

@firwareslut

I send you a pm to test this new feature
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: adding bash alias

Postby firwareslut » Tue Apr 15, 2014 5:15 am

cool I will check this out!

Maybe we should compile a tips and tricks page to collate all these handy things into a single place?
firwareslut
Donator VIP
Donator VIP
 
Posts: 202
Joined: Thu Oct 06, 2011 11:53 am

Re: adding bash alias

Postby firwareslut » Thu Apr 17, 2014 12:23 pm

It worked after a reboot. I haven't installed a new firmware now to see if it survives that yet :D
firwareslut
Donator VIP
Donator VIP
 
Posts: 202
Joined: Thu Oct 06, 2011 11:53 am

Re: adding bash alias

Postby Jocko » Thu Apr 17, 2014 1:53 pm

Hi firwareslut,

Be careful, you can not really check if it survives after a new firmware install.
Because currently no firmware image contains the new boot script (with the commands to edit the profile file), your aliases won't be restored.

To test if it's ok, after installing the new firmware image and rebooting, you must copy the rcS file of my sent tar file in /etc/init.d
check if it has still run permissions and its owner is root before restarting.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France


Return to Lacie Network Space vs2 and max version

Who is online

Users browsing this forum: No registered users and 2 guests