12-25-2008
Korn Shell Variable values difference
I am using two shell scripts a.ksh and b.ksh
a.ksh
1. Sets the value
+++++++++++++++++
export USER1=abcd1
export PASSWORD=xyz
+++++++++++++++++
b.ksh
2. Second scripts calls sctipt a.ksh and uses the values set in a.ksh and pass to an executable demo
++++++++++++++++++++++++++++++++++++++
. /local/home/Scripts/a.ksh
echo $USER1
echo $PASSWORD
demo -user "${USER1}" -password "${PASSWORD}"
++++++++++++++++++++++++++++++++++++++
Result
demo -user $'abcd1\r' -password $'xyz\r'
Problem is echo $USER1 and $PASSWORD both shows correct value as "abcd1" and "xyz",but when passed to demo executable it shows $'abcd1\r'. How to avoid these values when passed to external application.
K
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am attempting to itterate through a file that has multiple lines and for each one read the entire line and use the value then to search in other files. The problem is that instead of an entire line I am getting each word in the file set as the value I am searching for. For example in File 1... (2 Replies)
Discussion started by: run_unx_novice
2 Replies
2. Shell Programming and Scripting
in a text " Korn Shell Unix programming Manual 3° Edition"
i have found this sintax to declare a compoud variable:
variable=(
fild1 (0 Replies)
Discussion started by: ZINGARO
0 Replies
3. Shell Programming and Scripting
in a text " Korn Shell Unix programming Manual 3° Edition"
i have found this sintax to declare a compoud variable:
variable=(
fild1
fild1
)
but this sintax in ksh and sh (HP-UNIX) not work...
why?? exist another solution for this type of variable ??? (5 Replies)
Discussion started by: ZINGARO
5 Replies
4. Shell Programming and Scripting
Hi All-
First time using iSql.
I have 4 query files - some have more than 1 line of sql statements
After a bit of research it appears I can just use the -i command and specify the input file.
Questions:
Does it matter that there are multiple queries in each file? Do I need to have... (3 Replies)
Discussion started by: Cailet
3 Replies
5. Programming
Hi
I have the following block of code in korn shell and don't now how to refer to variable `print variable1.$dvd` ?
---
integer dvd=4
integer number=0
while (( dvd!=0 ))
do
print "Iteracja numer : $dvd"
print "$_" #it refers to $dvd var but want to refer... (3 Replies)
Discussion started by: presul
3 Replies
6. Shell Programming and Scripting
Enclosed is comma separated text file. I need to write a korn shell program that will parse the text file and insert the values into Oracle database.
I need to write the korn shell program on Red Hat Enterprise Linux server.
Oracle database is 10g. (15 Replies)
Discussion started by: shellguy
15 Replies
7. Programming
this is my issue.
4 parameters are passed from korn shell to sql script.
parameter_1= varchar2 datatype or no value entered my user.
parameter_2= number datatype or no value entered my user.
parameter_3= number datatype or no value entered my user.
parameter_4= number datatype or no... (5 Replies)
Discussion started by: megha2525
5 Replies
8. Shell Programming and Scripting
Hi All,
we are doing automation for installation of oracle,
a) ORACLE_HOME_NAME
b) ORACLE_HOME
above are the argument we need to pass during the script execution, while doing this someone issue the value like
ORACLE_HOME=/optware/oracle/11g;rm -rf /optware/oracle/10g
its removing... (1 Reply)
Discussion started by: kamauv234
1 Replies
9. Shell Programming and Scripting
I'm in the process of writng a function that consists of a case statement is there a way of calling the function and passing a value to it?
ie
function1 () {
case
opt1 do .....
opt2 do.....
esac
}
function opt1
I'm aware the syntax is not correct, but you get the general idea. (1 Reply)
Discussion started by: squrcles
1 Replies
10. UNIX for Dummies Questions & Answers
Hi
I am using two shell scripts which are running on the system simultaneously. And in one of the script i am exporting an Integer Variable.
Now i want to use the variable in another script. But i cannot run the first script in the second as the first script has many other functions which... (3 Replies)
Discussion started by: Ajesh
3 Replies
LEARN ABOUT OPENSOLARIS
suspend
suspend(1) User Commands suspend(1)
NAME
suspend - shell built-in function to halt the current shell
SYNOPSIS
sh
suspend
csh
suspend
ksh
suspend
DESCRIPTION
sh
Stops the execution of the current shell (but not if it is the login shell).
csh
Stop the shell in its tracks, much as if it had been sent a stop signal with ^Z. This is most often used to stop shells started by su.
ksh
Stops the execution of the current shell (but not if it is the login shell).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
csh(1), kill(1), ksh(1), sh(1), su(1M), attributes(5)
SunOS 5.11 15 Apr 1994 suspend(1)