Question variables Korn


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Question variables Korn
# 1  
Old 11-05-2001
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.
# 2  
Old 11-05-2001
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"
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

'*' vs. '@' in Korn Shell Array Variables

In order to use the shellcurses functions described at: Shell Curses function library I am learning about ksh, which has arrays. My trusty Kochan & Wood book says that for any Korn Shell array AR : ${AR } expands to all the defined array elements, and ${#AR } expands to the number... (3 Replies)
Discussion started by: Clovis_Sangrail
3 Replies

2. Shell Programming and Scripting

floating point variables korn shell

Hi I'm not using Korn93 but want to use floating point variable. Is there any solution to do that ? thx for help. ---------- Post updated at 02:28 PM ---------- Previous update was at 12:38 PM ---------- I have the following peace of code: for n in `cat log.January.1.array` do ... (3 Replies)
Discussion started by: presul
3 Replies

3. Shell Programming and Scripting

Question about a simple Korn script

Hi to everybody! I want to write a simple script in ksh that decrypts and encrypts using the DES algorithm. There is no builtin function in UNIX : i have found only a function in openssl but i don't understand how to use it. The script must accept in input the plaitext and the DESKEY in... (2 Replies)
Discussion started by: kazikamuntu
2 Replies

4. UNIX for Advanced & Expert Users

Accessing PL/SQL OUT variables in Korn Shell Script

Hello All, I was just wondering if there is any direct way to access PL/SQL OUT variables from Korn Shell Script. I could already figure out how to return a single value back from PL/SQL to Shell Script (using bind variable). But, what if we want to return multiple values? One option I... (4 Replies)
Discussion started by: bright_future
4 Replies

5. Shell Programming and Scripting

How to: Parse text string into variables using Korn shell

I am writing a script to keep check on free disk space, and I would like to find a way to parse $LINE (see code below) into a numeric value (for free disk space percentage) and a string value (for mount point). If possible, I would like to avoid sed or any additional use of awk since I am not very... (7 Replies)
Discussion started by: shew01
7 Replies

6. Shell Programming and Scripting

Korn shell and awk question

I am modifying a Korn shell script in using the Exceed (Solaris 10 environment). My task is to read in a .txt file with dates arranged like this (01-Sep-2006). I am to read each line and take the dates, compare them to a benchmark date and depending on if it is older than the date or the date and... (6 Replies)
Discussion started by: mastachef
6 Replies

7. Shell Programming and Scripting

Variables Naming in Korn Shell

Hi every body, I want to know what is the different between the following: $VAR1 ${VAR2} "${VAR3}" Are they equivalent? Thanks in advance (1 Reply)
Discussion started by: aldowsary
1 Replies

8. Shell Programming and Scripting

korn shell question

Hi all, I am trying to tweak my ksh , i am running V: Version M-11/16/88i I have my Backspace and up/down arrows working using the following code in my ~/.profile file. set -o emacs alias __A=$(print '\020' ) alias __B=$(print '\016' ) alias __C=$(print '\006' ) alias __D=$(print... (4 Replies)
Discussion started by: mich_elle
4 Replies

9. Shell Programming and Scripting

AWK question in the KORN shell

Hi, I have two files with the following content: gmrd.txt 235649;03;2563;598 291802;00;2563;598 314634;00;235649;598 235649;03;2563;598 393692;00;2563;598 411805;00;2563;598 411805;00;2563;598 235649;03;2563;598 414037;00;2563;598 575200;00;2563;598 70710;00;2563;598... (11 Replies)
Discussion started by: penfold
11 Replies

10. Shell Programming and Scripting

Question about Korn Shell

In Korn Shell, can you use "go to" statements? Would you then put paragraph names with a colon? For example, would you specify "goto para1" and then have the paragraph with the label para1:? I am getting an error message when Idid this. I have my paragraph name 'clsbooks:' and I get... (13 Replies)
Discussion started by: Latha Nair
13 Replies
Login or Register to Ask a Question