setenv and export

Siggy Brentrup ubuntu at psycho.i21k.de
Fri Aug 21 08:25:31 UTC 2009


On Thu, Aug 20, 2009 at 21:11 -0500, Kipton Moravec wrote:
> I am trying to setup java to do serial port stuff, and I do not know
> java, I just want to run a stupid program. 

Maybe you'd better ask for a replacement of that silly
java program :-) but see below: 

>                                           So I have to install Sun Java
> Communications API for Linux.
> 
> One of the steps is:
> 
> 2. If you are using JDK (not JRE) Add comm.jar to your classpath.
> 
>  Example: If you don't have a CLASSPATH set currently,
> 
>      % setenv CLASSPATH `pwd`/comm.jar
> 
> or,  if you have something in your CLASSPATH already,
> 
>     % setenv CLASSPATH `pwd`/comm.jar:$CLASSPATH 
> 
> --------------
> 
> And setenv does not work. Because it is not a bash command which is the
> default for most of the Linux operating systems. It is a c shell
> command.
> 
> Fortunately I was able to search and find that export is the equivalent
> command.
> 
> echo $CLASSPATH
> 
> Showed I did not have anything in the class path.
> 
> export CLASSPATH=/home/kip/APRS/bin
> 
> But it is not persistent across booting. Do I have to initialize it each
> time I want to run my program (which is from boot-up to shutdown).
> 
> How is the best way to do this?
> 
> What is 'pwd' in the example, and why is it there? (Does it make it
> persistent?)

`pwd` (note the backquotes) can also be written as $(pwd) and stands
for the result of the pwd command, i.e. the current working directory.

If you want to set environment variables systemwide, look at
  /etc/environment # exports are implicit here
but use it sparingly.

If you want to set environment variables for a specific account
place export statements in .zshrc, .bashrc ... depending on
which shell you are using.  If you are switching shells often,
you may also consider to put these settings in a separate file,
say $HOME/.environment which is sourced from the .*shrc files.

HTH
  Siggy
-- 
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
|56 days until|bsb-at-psycho-dot-informationsanarchistik-dot-de
|www.Ubucon.de|or:                bsb-at-psycho-dot-i21k-dot-de
========> ceterum censeo javascriptum esse restrictam <========
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090821/2da6a522/attachment.sig>


More information about the ubuntu-users mailing list