The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
DNS ENUM RR interpretation smanu IP Networking 1 11-03-2007 01:33 PM
interpretation of sar pascalbout AIX 0 03-01-2006 10:24 AM
SAR -b interpretation jimthompson UNIX for Advanced & Expert Users 3 10-26-2005 10:12 AM
Interpretation of the uptime command odin1999 UNIX for Dummies Questions & Answers 5 03-03-2004 11:01 AM
shell interpretation PhilippeCrokaer UNIX for Dummies Questions & Answers 1 06-13-2002 01:06 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-24-2002
uday uday is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 5
Prevent bash from interpretation :

I am using bash shell; my requirement is to run a long command.

Now I have split this long command into a number of shell variables.
Some of these shell variables contain special character ':’

At the end, when the intended long command is executed as a series of small shell variables the ':' is interpreted by the bash shell.

How can I prevent bash from not interpreting ':' ?
  #2 (permalink)  
Old 06-24-2002
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
Can you tell us what the commands the variables are being used in.....this can have a large bearing on how the character is interpreted by the shell.
  #3 (permalink)  
Old 06-24-2002
uday uday is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 5
export IFS="^"
LibsDir=$YJHOME/LLib
YJLIB=$YJHOME/YjAge/YjAge.jar:$LibsDir/classes12.zip
REQJBLIB=$LibsDir/jdsserver.jar:$LibsDir/beandt.jar:$LibsDir/dx.jar:$LibsDir/sunrsasign.jar
EXTRAJBLIB=$LibsDir/i18n.jar:$LibsDir/javaplugin.jar:$LibsDir/javaplugin_l10n.jar:$LibsDir/rt.jar
JDEVELOPLIB=$LibsDir/jndi.jar:$LibsDir/jta.jar:$LibsDir/nls_charset12.jar:$LibsDir/nls_charset11.jar:$LibsDir/classes111.jar
YJCLASSPATH=$YJLIB:$REQJBLIB:$EXTRAJBLIB:$JDEVELOPLIB:$CLASSPATH
RPOL=-Djava.security.policy=jar:file:$YJHOME/YjAge/YjAge.jar!/rmi.policy
java -classpath $YJCLASSPATH -Djava.security.manager $RPOL com.yj.age.AgeBody &
==========================================
After I have added export IFS="^", in YJCLASSPATH I get an space ' ' between the concatination of variables
  #4 (permalink)  
Old 06-24-2002
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
Okay. So you have lots of lib locations and you are trying to set these all as variables within your script...so that you can define the YJCLASSPATH for the java command at the end.

What is the error you are getting.....and can you put in some echos after certain points to see what the variables have been assigned with....particularly YJCLASSPATH and RPOL. let me know what you arrive at.
  #5 (permalink)  
Old 06-25-2002
uday uday is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 5
File /tmp/4.sh has below entry
export IFS=^
echo ++++++++++++++++++++++++++++++++++++
export MYJAR="$YJHOME"/Yj/YjAge.jar
export XERCESJAR="$YJHOME"/LinuxLib/sax.jar
export CLASSPATH="$MYJAR":"$XERCESJAR"
echo $CLASSPATH
echo ---------------------------------------

file: 1 has this entry
/tmp/4.sh


Now I exucute using
sh ~/1

YJHOME is set to
/tmp

I get following result:
++++++++++++++++++++++++++++++++++++
/tmp/Yj/YjAge.jar :/tmp/LinuxLib/sax.jar
---------------------------------------

As you can see I get this space between last jar for the first variable value and the begining of the next variable value
  #6 (permalink)  
Old 06-25-2002
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
Okay...makes sense (your explanation does - the problem doesn't).

Can you add a couple of more echoes...one for
echo $MYJAR
$XERCESJAR

Also I'm assuming you've checked that there is no whitespace at the end of the variable definitions? i.e a space after the last character of this line:
export MYJAR="$YJHOME"/Yj/YjAge.jar

Because it is a variable it's effectively just a string until it is used...so spaces will count and be applied later on.

Using vi - you can use :set list

This will show you any white space at the end of the line before the eol character ($)

Try these things and let me know again.
  #7 (permalink)  
Old 06-26-2002
uday uday is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 5
I think I found the problem

I had edited this original file from windows 2000 machine to Linux machine using default ftp protocol. This comes with IE browser.

Later I had given chmod +x on 4.sh file.

In such a case when i execute file 4, an additional space appears while appending variable values.

Now I have converted this file from dos type to UNIX type using dos2unix utility, this has resulted in making additional space to disappear

I appreciate your effort.
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0