![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DNS ENUM RR interpretation | smanu | IP Networking | 1 | 11-03-2007 09:33 AM |
| interpretation of sar | pascalbout | AIX | 0 | 03-01-2006 06:24 AM |
| SAR -b interpretation | jimthompson | UNIX for Advanced & Expert Users | 3 | 10-26-2005 07:12 AM |
| Interpretation of the uptime command | odin1999 | UNIX for Dummies Questions & Answers | 5 | 03-03-2004 07:01 AM |
| shell interpretation | PhilippeCrokaer | UNIX for Dummies Questions & Answers | 1 | 06-13-2002 10:06 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
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 ':' ? |
| Forum Sponsor | ||
|
|
|
|||
|
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 |
|
|||
|
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.
__________________
Pete |
|
|||
|
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 |
|
|||
|
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.
__________________
Pete |
|
|||
|
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. |
|||
| Google The UNIX and Linux Forums |