GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Korn shell scripting (https://gfy.com/showthread.php?t=127350)

FATPad 04-22-2003 03:19 PM

Korn shell scripting
 
Friend of mine just posted this gibberish on one of our game related messageboards. I told him I would ask around cuz I'm such a good friend.

What does it mean and what's the answer?

<---------------------------------------------------->
This is going to be a VERY basic question, but I cant get the damn syntax right.

Script A. Script B.

Script A calls Script B.

I want to pass a variable's values from script B to script A. I know I do this by doing

echo $variable

Now how do I retrieve that value in script A? In order to get some Unix functions to work, I have to use echo in another part of script B. I do NOT want that value in script A.

any idea?

I saw some code that look like

variable= `script B "var1 {var2_string}"`

that wont work if I have more than one echo in script B. What do I do?
<---------------------------------------------------->

Thanks in advance. :)

daddio 04-22-2003 05:35 PM

Try this

scriptB:

#!/usr/local/bin/ksh -p # -- (Your path to ksh)
MYVARIABLE="hello" ; export MYVARIABLE

scriptA:

#!/usr/local/bin/ksh
. /$HOME/scriptB # -- Path to script B (Example)
echo $MYVARIABLE

:thumbsup

FATPad 04-22-2003 07:12 PM

Thanks. I'll let him know. :)

detoxed 04-22-2003 07:23 PM

I dont like Korn.


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

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123