![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages 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 | 12-02-2008 12:02 PM |
| Accessing Shell Variables in awk or sed | nasersh | Shell Programming and Scripting | 3 | 05-05-2008 07:44 AM |
| snmp ... mib2c.scalar.conf, how manipulate variables | zainab | IP Networking | 0 | 04-12-2008 12:51 AM |
| accessing unix variables in oracle | ravi raj kumar | High Level Programming | 1 | 02-06-2008 11:05 AM |
| accessing ksh variables from awk | trupti wagh | Shell Programming and Scripting | 1 | 02-26-2007 04:11 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
if they're asking for system environment variables, you can echo the variables and find the path, or i believe you can use "set env" commands. i haven't needed to do that very often though. i might also be mis-understanding what you're asking and be completely way off base.
remember to export your variables as well. |
|
||||
|
I need to define variables in a file called usermon.conf and then read in the variables from my main program to use there. I can do the rest of the program, by defining the variables in the program, but I can't figure out how to read in variables from another file.
|
|
||||
|
One example of many ways to read config data
Example contents of a config file name my.config
_____________________________ Some config data _____________________________ In program that needs config file info ___________________ #!/bin/ksh #my example program read configline <my.config echo "The config data is $configline" ___________________ Another example with same config file _____________________________ #!/bin/ksh #my second example program read one two three<my.config echo "The first word was $one" echo "The second word was $two" echo "The third word was $three" _____________________________ |
|
||||
|
can't you just source the file like this
Code:
#!/usr/bin/ksh . usermon.conf #reads the file into the current script Code:
myvar1="whatever1" myvar2="whatever2" myvar3="whatever3" i could be completely wrong... i need to install unix at home so i can verify the crap i'm trying to remember from work! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|