bash shell variables


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers bash shell variables
# 1  
Old 04-15-2002
Data bash shell variables

Hi everyone,

I have added this to my .bash_profile. Whenever I log in and when I type javac I get a error message (java: command not found). Does the order counts?

PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
JAVA_HOME=$JAVA_HOME/usr/local/jdk1.3.1_02


export JAVA_HOME PATH

Thanks
ny
# 2  
Old 04-15-2002
the order does matter - it can't place a value into PATH if there is none (at that point JAVA_HOME isn't a variable)

Put your lines in this order and remove $JAVA_HOME (unless it was equal to something before this (which I doubt)).

JAVA_HOME=/usr/local/jdk1.3.1_02
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
thehoghunter
# 3  
Old 04-15-2002
how about export?
does the order count for that too?
# 4  
Old 04-15-2002
The export order does not matter. Check the man page on ksh and export
thehoghunter
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing awk variables to bash variables

Trying to do so echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies

2. Shell Programming and Scripting

BASH arrays and variables of variables in C++

Sometimes it is handy to protect long scripts in C++. The following syntax works fine for simple commands: #define SHELLSCRIPT1 "\ #/bin/bash \n\ echo \"hello\" \n\ " int main () { cout <<system(SHELLSCRIPT1); return 0; } Unfortunately for there are problems for: 1d arrays:... (10 Replies)
Discussion started by: frad
10 Replies

3. Shell Programming and Scripting

Sourcing .cshrc (C shell) environment variables to bash

I have tried with the following: csh -c 'source ~/.cshrc; exec bash' # works perfectly (cat ~/.cshrc; echo exec bash) | csh # not working And, using sed, I successfully retrieved the environment variables from ~/.cshrc sed -rn 's/setenv\s+(\S+)\s+(.*)$/export \1=\2/p' ~/.cshrc but now... (6 Replies)
Discussion started by: royalibrahim
6 Replies

4. Shell Programming and Scripting

Indirect variables in Bash

Hello, I've spent hours this morning reading various past forum posts and documentation pages but I can't find exactly what I need. I'm trying to call a variable with a variable in the name without having to make a third variable. For example: path=AB legAB=50 leg$path I want to... (8 Replies)
Discussion started by: DFr0st
8 Replies

5. Shell Programming and Scripting

functions and variables in bash

I have a bash script with some functions as below and am wondering if I can use the variables declared in setup in the other functions and in the rest of the bash script. setup(){ none=0; low=1; medium=2; high=3; debug=4 var1="red" var2="fred" } create_basemap() { ... (7 Replies)
Discussion started by: kristinu
7 Replies

6. Shell Programming and Scripting

while loops and variables under bash

Hi, This is probably going to be very simple but i came across something i can't quite explain. Here is the situation: i have a list of files, which i'd like to process one by one (get the size, make some tests, whatever) and generate some statistics using different variables. Something... (5 Replies)
Discussion started by: m69w
5 Replies

7. UNIX for Advanced & Expert Users

[bash] variables and if conditions

Hello. Sorry for the stupid question... Here is the problem. I'm trying to do a script that offers options for backup the root partition in unix sistems. Here is the code part that i am talking of. echo "tar can archive your file using gzip or Bzip2" echo "gzip : relatively poor... (7 Replies)
Discussion started by: editheraven
7 Replies

8. Shell Programming and Scripting

how to use in bash variables and quotes

I have some troubles with variables and quotes... I want: if $URL is empty (no user input) go to http://www.localhost/index.php/ else add this string (search) "?s=+$URL" EXAMPLE: No user input string= http://www.localhost/index.php/ User input = "unix" string=... (3 Replies)
Discussion started by: aspire
3 Replies

9. Shell Programming and Scripting

Bash variables

Ummm can anybody help me with this one? Its prob quite simple. I bascially have a file name say J1x2x3x7.dat Im using the file name as a variable in a bash script. Want I want to do is extract most of the file name and make it a new variable expect with say one of the number now a... (2 Replies)
Discussion started by: RichieFondel
2 Replies
Login or Register to Ask a Question