Posts: 23
Joined: Wed Jun 20, 2012 12:56 pm

Run a file after login

Fri Aug 09, 2013 11:28 pm

Hi all,

Asked a similar question over in the gaming section but haven't had a response so thought I would post here.

I have set user "pi" to auto login on boot and now I would like USP to start automatically after this. How can I do this? Read something about /etc/profile but don't understand it enough to implement it.

At the moment I have to type: cd /usp [press enter] then ./unreal_speccy_portable [enter]

What is the easiest way to have this launch straight after boot up?



Posts: 114
Joined: Thu Jan 05, 2012 11:22 pm

Re: Run a file after login

Sat Aug 10, 2013 1:29 am

I'm assuming you are using Raspbian.

When You log in you are given a bash shell. While bash is coming up (so you can type in it) it reads and executes commands in the file /home/pi/.bashrc. Since this file starts with a period (.) it is normally hidden. A directory listing with the -a (lowercase a) parameter (ls -a) will list all the hidden files.

You can add the command you want to execute at each login to the bottom of .bashrc with the editor of your choice. I use vi. ymmv.

My guess at the command you want to add to .bashrc is:


without the single quotes. This assumes the usp directory is under the root of the file system (/) and not under the user pi's home directory.
Any conversation about a sufficiently complex subject is indistinguishable from babble.

Return to “General discussion”