Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am relitively new to linux and just download a program. It ask me to set the environment variable VAR to the name of a directory.
I tried both in command line: "export VAR=/home/dir/"
but the system just say: "export: Command not found."
How can I set an environment variable?
The method you used should have worked. Just to be sure, I just tried it, and it worked for me. You must be typing into a bash shell, because it's bash that you're asking to export this variable with its value. You should also be able to pass VAR to the program, call it "prog", this way: "VAR=/home/dir/ prog".
export command is built into bash and ksh. If you are using another shell (e.g. csh or tcsh) it might not be. Variable assignments in other shells are done differently. For example in the original Bourne shell (sh) you had to do two steps:
(or VAR=value;export VAR - the semicolon makes it execute the second part of the line after the first part as if you had typed two lines.)
Type "ps" without any options - this should show you what shell you are running.
If it shows "sh" instead of bash or ksh then type "which sh" - this will show you where it found the "sh" command (e.g. /bin/sh).
Type "ls -l <path-to-shell>" where path to shell is what you found in the prior step. Look to see if /bin/sh is a link (will show a right arrow pointing to another file) to something else. Someone recently posted that they were linked to tcsh.
You could just assign the environmental variable in your ~/.profile script. Here is an example from mine:
# Most applications support several languages for their output.
# To make use of this feature, simply uncomment one of the lines below or
# add your own one (see /usr/share/locale/locale.alias for more codes)
#export LANG=de_DE.UTF-8 # uncomment this line for German output
#export LANG=fr_FR.UTF-8 # uncomment this line for French output
#export LANG=es_ES.UTF-8 # uncomment this line for Spanish output
Removing the "#" character would redefine LANG. The ~/.profile script is sourced when you log in.