new scripter


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting new scripter
# 1  
Old 09-26-2007
Computer new scripter

Hello all,

new to scripting (and unix!) here. Im trying to write a script for something i have to do for work and for some reason it just isnt working.

im using the ksh.

Can someone please tell me why

Code:
$PRODUCT=$1

CONFIG=./etc/$PRODUCT_config.xml

print Using $CONFIG

prints "Using ./etc.xml" ?
# 2  
Old 09-26-2007
Try this:
Code:
$PRODUCT=$1

CONFIG=./etc/${PRODUCT}_config.xml

print Using $CONFIG

The shell is interpreting PRODUCT_config as the variable name rather than PRODUCT, because _ is allowed to be part of variable name.
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Begining Shell scripter

I am trying to write for my class project a shell script, using bourne shell, that will take one command, either -l or -w. If -l is entered then the script should output the names of all the files in my working directory sorted in increasing order of the number of lines in the file. If -w is input... (2 Replies)
Discussion started by: C.Ronaldo-7-
2 Replies
Login or Register to Ask a Question