Re: Changing the Bash/SSH prompt
- From: "Aaron Gray" <ang.usenet@xxxxxxxxx>
- Date: Tue, 3 Jan 2006 20:12:35 -0000
>>>>> If you don't want logout and then login again, you can run
>>>> . ~/.bashrc
>>
>> That was usefull to know, but how does it actually do it
>
> It's s short form of the built in source command of bash, here is the
> section
> from the man page
>
> . filename [arguments]
> source filename [arguments]
> Read and execute commands from filename in the current
> shell
> environment and return the exit status of the last command
> exe-
> cuted from filename. If filename does not contain a slash,
> file
> names in PATH are used to find the directory containing
> file-
> name. The file searched for in PATH need not be
> executable.
> When bash is not in posix mode, the current directory
> is
> searched if no file is found in PATH. If the sourcepath
> option
> to the shopt builtin command is turned off, the PATH is
> not
> searched. If any arguments are supplied, they become the
> posi-
> tional parameters when filename is executed. Otherwise
> the
> positional parameters are unchanged. The return status is
> the
> status of the last command exited within the script (0 if
> no
> commands are executed), and false if filename is not found
> or
> cannot be read.
AFAIC understand, if that is so, is the 'export' command really necessary ?
Or does the normal login execution require the export ?
>> I do not understand the syntax, why '.' space, why the tilde ?
>> Why not just './.bashrc' ?
>
> tilde is used as a simple replacement for the absolute path to the users
> home
> directory, it's always regexpr to the absolute path before it's handed
> over to
> the command itself (this is done by the shell, in this case bash).
> ~username works too and you can use it for another users home directory.
>
> Why use ~/.bashrc instead of ./.bashrc, what if you aren't in your home
> directory, but say in /usr/local, as you don't have your bashrc there, the
> source/environment update would fail.
Are thats useful.
Thanks,
Aaron
.
- Follow-Ups:
- Re: Changing the Bash/SSH prompt
- From: J.O. Aho
- Re: Changing the Bash/SSH prompt
- References:
- Changing the Bash/SSH prompt
- From: Aaron Gray
- Re: Changing the Bash/SSH prompt
- From: J.O. Aho
- Re: Changing the Bash/SSH prompt
- From: Aaron Gray
- Re: Changing the Bash/SSH prompt
- From: J.O. Aho
- Re: Changing the Bash/SSH prompt
- From: Aaron Gray
- Re: Changing the Bash/SSH prompt
- From: J.O. Aho
- Changing the Bash/SSH prompt
- Prev by Date: Re: Pan scorefile question...
- Next by Date: Re: Changing the Bash/SSH prompt
- Previous by thread: Re: Changing the Bash/SSH prompt
- Next by thread: Re: Changing the Bash/SSH prompt
- Index(es):
Relevant Pages
|