Results 1 to 6 of 6
hi.
first, i'm quite new to linux.
I would like to know if there is any custom files that is 'automatically supported' (ie .bash_aliases) by linux which i can create ...
- 01-27-2009 #1
[SOLVED] path in a custom file
hi.
first, i'm quite new to linux.
I would like to know if there is any custom files that is 'automatically supported' (ie .bash_aliases) by linux which i can create and adds to following
lines:
PATH=$PATH
export PATH:/new/path
Thanks.
By the way, this forum is quite fast!
- 01-27-2009 #2Linux User
- Join Date
- Feb 2006
- Posts
- 484
path is stored in two files
system wide : /etc/profile
user spcific: ~/.bashrc
The bash automatically interpret this file on login or each start of a terminal emulator. You can store your own paths , command aliases, and many things.
This treated as a bash script so you can write sripts here too.
- 01-28-2009 #3
hi
i know about the ~/.bashrc. but what i want is to, as i'm new, preserve that file without modifing it at all. As i'm new, if i got some troubles with my os, i'll be sure that it doesn't came from modifiyng that file. Also, is problems surgeon all that i will have to do is to delete my custom file. This is way i was aking that question.
Well, i guess i don't have any other options. In the .bashrc profile, is there any 'section' where i can put my custom command lines ?
Thanks for reading/answering.
I wish you to have a good day.
- 01-29-2009 #4Linux User
- Join Date
- Feb 2006
- Posts
- 484
there are no sections, you can divide the file logically but no need to mark this.
Feel free to use this file and if you screw up your user you can restore the file as root
- 01-29-2009 #5
Okay.
Thanks.
I'm gonna try out those things.
By the way, and just to confirm that i'm right, in the .bashrc:
if [ -f ./.bash_aliases ];
# somethings here
fi
is just a condition statement to check if the file exist, if so,
execute # something here, right ?
(notice that agreeing to the above question will makes me thinking that -f is equivalent to bash -f FILENAME.)
- 01-30-2009 #6Linux User
- Join Date
- Feb 2006
- Posts
- 484
hi
Linux has a command called test you can do tests with this command.
In a shell script the "[ condition statement here ]" equivalent with "test condition statement here".
You can check the options for test in man.
I suggest you give full path in the condition , like ~/.bash_aliases instead of ./.bash_aliases.
And yes if the condition true "#somethings here " will run.



