Conf file entry.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Conf file entry.
# 1  
Old 01-12-2011
Conf file entry.

Hi,

Lets say I have a script which reads a conf file (say MASTERFILE) line by line to fetch file_name, source_path, dest_path. But currently, here the file name are static for eg: ABC.txt or XYZ.txt. So i have hard-coded in the conf file.
So what happens that the script picks up the file_name from source_path and put it on the dest_path. Until this point all are ok as file_name is static.

Now my issue is:

Few files I have which are generating with the timestamp in the source_path, so naturally I cannot put that in the conf file.
For eg: today a file generate as TEST1_20110113, then tomorrow as TEST1_20110114, then TEST1_20110115.
Now how I can make an entry in the conf file or how I can change my script (which cat the MASTERFILE and reads line by line takes file_name, source_path, dest_path in variable and operate on that) so that I can use static file name and dynamic file name (as shown above) also to perform certain actions.

Please note: I donot want to hardcode file_name in the script at any point of time. It should fetch file name from MASTERFILE.

Please assist.
# 2  
Old 01-12-2011
Please post your script to see where you are stuck.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Configure resolv.conf and nsswitch.conf

Hi, I've installed Solaris 11.3(live media) and configured DNS. Everytime I reboot the server, resolv.conf got deleted and it created a new nsswitch.conf. I used below to configure both settings: # svccfg -s dns/client svc:/network/dns/client> setprop config/nameserver = (xx.xx.xx.aa... (1 Reply)
Discussion started by: flexihopper18
1 Replies

2. Shell Programming and Scripting

Script to update rsyslog.conf and auditd.conf

Hello all, Newbie here. I'm currently tasked with updating rsyslog.conf and auditd.conf on a large set of servers. I know the exact logging configurations that I want to enable. I have updated both files on on a server and hope to use the updated files as a template for the rest of the... (3 Replies)
Discussion started by: Mide
3 Replies

3. How to Post in the The UNIX and Linux Forums

Help me, write a bash script to delete parent entry with all their child entry in LDAP UNIX server

Hi All, Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries. example: Parent is : ---------- dn: email=yogesh.kumar@wipro.com, o=wipro, o=in child is: ---------- dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Discussion started by: Chand
1 Replies

4. UNIX for Advanced & Expert Users

How can i tell which conf file it is using

i have this program running on my solaris and there are two identical config files, i am not sure which one is being used by this program but I am sure it uses one of them. I run lsof -p {pid} but it does not show which config file has been read by this program, what i am doing wrong? thanks (4 Replies)
Discussion started by: fedora
4 Replies

5. Solaris

basic question on sd.conf and lpc.conf file

Hello Guys, Do we need to configure this file only if we add SAN disk or even if we add local disk, do we need to modify? (4 Replies)
Discussion started by: mokkan
4 Replies

6. Solaris

Want to know about a entry in syslog.conf

Hi Everyone, I just wanted to know about the below entry in syslog.conf in Solaris 10: kern.notice @destserver Now the log will be redirected to destserver. But I want to know the location on the destserver where this log will be thrown. Thanks in Advance, Deepak (4 Replies)
Discussion started by: naw_deepak
4 Replies

7. UNIX for Advanced & Expert Users

Configuring snmpd.conf and snmptrapd.conf

HI, I want a help for Configuring snmpd.conf and snmptrapd.conf (i.e Configuring SNMP) for receiving TRAPS in my networks. I am using RHEL4.0 OS. Please tell me How I can configure above two files in a proper way and at an advanced level. Especially I am getting... (2 Replies)
Discussion started by: jagdish.machhi@
2 Replies

8. IP Networking

snmptrap.conf file

Hi I tried a lot bt could not configure snmptrapd.conf... Can any one tell me the steps or give me the configured snmptrapd.conf file?? Its really important..Plz help me.. Thanx (0 Replies)
Discussion started by: swapna_me
0 Replies

9. Shell Programming and Scripting

delete dhcp.conf entry using sed

I am trying to use sed to remove entries from my dhcpd.conf file. The form of the file is: host foo { option 1 option 2 } host bar { option 1 option 2 } I was trying to use a label like: sed -e :a -e "s/^host bar {*//g;/{/N;//ba" /etc/dhcpd.conf... (2 Replies)
Discussion started by: tizatron
2 Replies
Login or Register to Ask a Question