Problem in korn script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem in korn script
# 1  
Old 08-10-2005
Problem in korn script

Hi i am facing this problem, please help me in my korn script

-------------------------------------------------------------
export $job_ids


echo "#Message creation" >message-typing.typ
chmod 777 message-typing.typ
echo "orderParser:1:999:210:T" >>message-typing.typ
echo "*REQUEST=FLOWTHRU;JOBID=${job_ids};OLD_DD=20050629000000;%" >>message-typing.typ


cat message-typing.typ
-------------------------------------------------------------

Now the job_ids is a variable consisting of job id, and if u see i have exported this variable too.
However, the message-typing.typ file when i see through the debugging mode consists of job id value, but once the script has terminated this job_id value dissappears, if i run on my unix prompt like
--------------------------------------------------------------
prompt> cat message-typing.typ
#Message creation
orderParser:1:999:210:T
*REQUEST=FLOWTHRU;JOBID=;OLD_DD=20050629000000;%
--------------------------------------------------------------

So any help please
Reply With Quote
# 2  
Old 08-10-2005
You have to source the korn shell script. One way is to do this with a leading dot
Code:
.  /path/to/kornshellscript.sh

# 3  
Old 08-10-2005
that is not needed, the error is basically on job id concentration
# 4  
Old 08-10-2005
I do not understand the problem: you want an environment variable to exist in the parent process when it is declared in the script? Yes or no?
# 5  
Old 08-10-2005
all i want is that this value of variable shud be preserved when im going from one script to the other
# 6  
Old 08-10-2005
Quote:
Originally Posted by pallavimahajan
all i want is that this value of variable shud be preserved when im going from one script to the other
Well that's not gonna happen.

Your first post is just a jumble of lines. I can't tell if that was supposed to be a script or not. But I did notice this line:
export $job_ids

I suspect that you might be attempting to export the variable named job_ids. If so, you need:
export job_ibs
# 7  
Old 08-10-2005
PHP

have tried this method too, with no luck
$job_ids or job_ids :: both way same result
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

pass null value to sql script from korn shell script

There are 4 parameters that I have to pass from korn shell to sql script. 1) I have to check if $1 , $2 , $3 and $4 are null values or not . How can I do that ? 2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
Discussion started by: megha2525
11 Replies

2. Shell Programming and Scripting

self-learning! my korn shell problem

i am a beginner i m learning shell by myself i have problem writing a korn shell that takes an absolute pathname to directory and display all ordinary files in the directory ordered by their length. i was thinking use grep ls sort and sed. maybe, i m wrong! can someone tell me? (2 Replies)
Discussion started by: babuda0059
2 Replies

3. Shell Programming and Scripting

korn shell display lenght problem!!! i got stuck on this

Using the KSH, write a shell script called display_by_length, which takes an absolute pathname to a directory and displays all ordinary files in the directory ordered by their length; for each file listed, display the name of the file and its length - nothing else. Extend this script to take an... (1 Reply)
Discussion started by: babuda0059
1 Replies

4. Shell Programming and Scripting

unix korn shell leap years problem

Write a function called dateToDays that takes three parameters -a month string such as Sep, a day number such as 18, and a year number such as 1962-and return s the number of days from January 1, 1900, to the date. Notes: I am asking you to account for leap years. my script is not... (0 Replies)
Discussion started by: babuda0059
0 Replies

5. Shell Programming and Scripting

Running a BATCH script from my korn script with multiparameters

I've this BATCH script to run from my korn script... The command is /usr/local/BATCH/runBatch.sh PARAM1 'PARAM2 -PARAM21 PARAM22' (runBatch takes parameter 1 = PARAM1 parameter 2 = 'PARAM2 -PARAM21 PARAM22' ) If i run this command from command line it just runs fine... ... (7 Replies)
Discussion started by: prash184u
7 Replies

6. Shell Programming and Scripting

AIX Korn shell sed -s problem

In a Korn shell script I have, cat ../header | sed -e 's/flag1/$cnumb/g' > header.txt The header is short {{Company flag1}} But the result in header.txt is {{Company $cnumb}} The value of $cnumb is 120. I am trying to get the value of $cnumb into the header. I have tried /'$cnumb'/g,... (10 Replies)
Discussion started by: jcarrott
10 Replies

7. Shell Programming and Scripting

korn shell automation problem!

I got the task writting Korn Shell script to automate the tuxedo login so that users neednot have to enter options manually. I have done that using expect tool from the Unix but my manger told me its not secure so you have to do that using Kornshell without using Expect. Here is the way to login to... (0 Replies)
Discussion started by: pareshan
0 Replies

8. Shell Programming and Scripting

Problem with Korn Shell

My Korn shell script below is giving me the following error: ./test.ksh: 0403-057 syntax error at line 7 : 'then' is not matched. Can anyone provide a quick solution as to why the error is occurring? Thanks. #!/usr/bin/ksh typeset -i RecCount typeset -i RecCount2 RecCount=`db2 -x "select... (23 Replies)
Discussion started by: sasaliasim
23 Replies

9. UNIX for Dummies Questions & Answers

problem extracting substring in korn shell

hi all, I have read similiar topics in this board, but i didn' t find the posting which is the same with the problem i face.. I try to extract string from the end. i try to do this: num=abcdefghij num2=${num:-5} echo $num2 #this should print the last 5 characters (fghij) but it doesn;t... (3 Replies)
Discussion started by: nashrul
3 Replies

10. Shell Programming and Scripting

problem with set command in korn shell

I have to copy an array to a temp variable and back after doing some functions. I am trying to see if it is possible to do without while loops.My closest try was set -A temp ${THE_ARRAY} # restore array after some actions set -A THE_ARRAY ${temp} The problem with above is that, the new... (1 Reply)
Discussion started by: vijay1985
1 Replies
Login or Register to Ask a Question