Re: Changing the Bash/SSH prompt



>>>>> 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


.



Relevant Pages

  • Re: User Inputs
    ... I have an M file which I want to make more usefull by allowing the ... It is a singnal processing thing and ... would require the user to enter the sample rate, ... the user to enter a value in the command line? ...
    (comp.soft-sys.matlab)
  • User Inputs
    ... I have an M file which I want to make more usefull by allowing the ... It is a singnal processing thing and ... would require the user to enter the sample rate, ... the user to enter a value in the command line? ...
    (comp.soft-sys.matlab)
  • Re: How to access network computers from command line ?
    ... but I don't see much usefull happen here ... with that command. ... comprehensible help for `runas' ... Neither of those does anything but display the help either ...
    (microsoft.public.windowsxp.network_web)
  • Re: upgrading
    ... > don't need to keep typing it on the command ... Very usefull, I often spell COMPAQ with COMPQ and ...
    (freebsd-stable)
  • Re: [ANN] parallel: simple parallel processing.
    ... allow for the possibility that forkcan fail, ... command that would have been executed by the shell which failed to start. ... You need to consider the case where the user specifies "." ...
    (comp.unix.shell)