The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Accessing PL/SQL OUT variables in Korn Shell Script bright_future UNIX for Advanced & Expert Users 4 14 Hours Ago 09:02 AM
How to: Parse text string into variables using Korn shell shew01 Shell Programming and Scripting 7 05-23-2008 07:01 AM
Variables Naming in Korn Shell aldowsary Shell Programming and Scripting 1 03-19-2006 09:30 AM
AWK question in the KORN shell penfold Shell Programming and Scripting 11 02-09-2005 06:14 AM
Question about Korn Shell Latha Nair Shell Programming and Scripting 13 11-05-2003 04:30 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-05-2001
Registered User
 

Join Date: Nov 2001
Posts: 10
Question Question variables Korn

I'm using the following command to test for certain characters in a script

echo "${1}" | grep '\$'
if (( ${?} == 0 ))
then


testing this script on the command line I have

ksh -x script1.sh "xxxx$xxxx"

this works fine but when I want to use

ksh -x script1.sh "xxxx $xxx"

the interpreter tells me that the field is blank. Why?
it dosen't like space how do I get around this? My script will be passed variables with spaces in them.
Reply With Quote
Forum Sponsor
  #2  
Old 11-05-2001
rwb1959's Avatar
Registered User
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
When passing arguments with special characters
for instance the "$" symbol, you should escape them
assuming you wish them to be passed to the shell
undisturbed. Otherwise, you command shell will try to
interpret it first and pass those results to your script.

try...
ksh -x script1.sh "xxxx \$xxx"
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0