Sponsored Content
Full Discussion: enhanced substitution
Top Forums Shell Programming and Scripting enhanced substitution Post 302364834 by pramach on Saturday 24th of October 2009 06:10:28 AM
Old 10-24-2009
enhanced substitution

Dear

I have a problem on which I turn araound since hours.
Hope you could help me.

I have a bash script, which activates with "nohup ./script2 params & " several subscripts.

In my main script, I have set lot's of variables, which I would pass into script 2.

My idea is now to create a file with parameter content, like:
envCode="X"
envPath="../temp/X"
...

Then I just pass over this parameter path & filename and execute it then in the subscripts.

So far this works well.

Here my questions:
1) Is there a possibility to create the parameter file more dynamically, e.g. by all parameters defined in main script when parameter file is created ? (like env but for script variables only..)

2) When I have a list of variable names I want to pass, how could I dynamically fill the parameter file.
E.g.
Code:
cat my_file_with_parameternames.txt
  envCode
  envPath

echo $envCode
  X

echo $envPath
  ../temp/X

for k in `cat my_file_with_parameternames.txt`
do
    echo $k=<value of $k variable>"  >> my_parameter_file.sh
done

cat my_parameter_file.sh
  envCode=X
  envPath=../temp/X

Maybe it's not the first time this question is asked, but to be honest, I'm google since hours... Most probably I do not know the correct words to search for ;-(

Any help would be great.

many thanks in advance
Wolfgang
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

C2 or enhanced security

We are using c2 / enhanced security on digital unix. I do not have access to the GUI. I need to get information on login status for users. Specifically I would like to know who has not logged in within the last 6 months. I think I can query the edauth files, but I can't find information on... (4 Replies)
Discussion started by: MizzGail
4 Replies

2. Solaris

Enhanced Password Authentication

Hello; I am moving a customer from Solaris 2.6 to Solaris 2.8. The customer has requested the following two requirements also be implemented: 1. Lock a user account out for X number of days after 3 unsuccessful login attempts. 2. No reuse of the last 5-10 passwords. Also referred to... (1 Reply)
Discussion started by: rambo15
1 Replies

3. UNIX for Advanced & Expert Users

Are there many UNIX server security enhanced products?

for sco, hp, or AIX...... anyway, how can I secure the UNIX system. I knew that CA has it's products for securing the UNIX server system. Please tell me more about other vender, and their products thxs! (0 Replies)
Discussion started by: brookwk
0 Replies

4. IP Networking

enhanced tcpdump is needed

Are there any standard programs in linux/unix like tcpdump that store packets' headers in db (Berkeley DB is preffered, including secondary db's to index stored headers by IP addesses, TCP flows, etc.), provide search in db and convert found headers to tcpdump dumpfile format? (12 Replies)
Discussion started by: Hitori
12 Replies

5. UNIX for Dummies Questions & Answers

Convergent Enhanced Ethernet

Hi. I guess this my dummy question is for super-gurus. I'm on Red Hat' documentation regarding their RDMA capabilities over "convergent" Ethernet network. I read everything that I could find on inet, wikipedia etc. about the technology itself. I can't figure out, how can I determine if the... (0 Replies)
Discussion started by: newlinuxuser1
0 Replies

6. AIX

Normal VG to Enhanced Concurrent VG

Hi All, I am going to perform some activity in 2Node HA Server(Active/Passive). For that i have to do some pre-requsite (ie., Resource Group VG's should be Enhanced-Concurrent) In my setup, we have two volume groups in one RG. In that one VG is Normal and another is Enhance Concurrent. ... (2 Replies)
Discussion started by: Thala
2 Replies

7. What is on Your Mind?

New Enhanced Forum Features for VIP Members

Dear All, Thank you for your support. As promised I have upgrade features for unix.com forum VIP members as follows: Who's Online Permissions Can View IP Addresses Can View Detailed Location Info for Users Can View Detailed Location Info of Users Who Visit Bad / No Permission... (0 Replies)
Discussion started by: Neo
0 Replies
GZEXE(1)						      General Commands Manual							  GZEXE(1)

NAME
gzexe - compress executable files in place SYNOPSIS
gzexe [ name ... ] DESCRIPTION
The gzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them (at a penalty in performance). For example if you execute ``gzexe /bin/cat'' it will create the following two files: -r-xr-xr-x 1 root bin 9644 Feb 11 11:16 /bin/cat -r-xr-xr-x 1 bin bin 24576 Nov 23 13:21 /bin/cat~ /bin/cat~ is the original file and /bin/cat is the self-uncompressing executable file. You can remove /bin/cat~ once you are sure that /bin/cat works properly. This utility is most useful on systems with very small disks. OPTIONS
-d Decompress the given executables instead of compressing them. SEE ALSO
gzip(1), gznew(1), gzmore(1), gzcmp(1), gzforce(1) CAVEATS
The compressed executable is a shell script. This may create some security holes. In particular, the compressed executable relies on the PATH environment variable to find gzip and some other utilities (tail, chmod, ln, sleep). BUGS
gzexe attempts to retain the original file attributes on the compressed executable, but you may have to fix them manually in some cases, using chmod or chown. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWgzip | +--------------------+-----------------+ |Interface Stability | External | +--------------------+-----------------+ NOTES
Source for gzip is available in the SUNWgzipS package. GZEXE(1)
All times are GMT -4. The time now is 04:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy