Sponsored Content
Full Discussion: Three scripts
Top Forums Shell Programming and Scripting Three scripts Post 302478274 by methyl on Tuesday 7th of December 2010 01:22:40 PM
Old 12-07-2010
As long as both scripts start before midnight, you only need to evaluate the date once at the start of the script.

See this illustration of storing the date in an environment variable then using it afterwards in a command.
Code:
YYYYMMDD="`date +%Y%m%d`"
echo "${YYYYMMDD}"

In fact you can then compose the whole filename in an environment variable and considerably shorten your subsequent command lines as well as making them easier to read.
For example:
Code:
FILENAME="MTA_${YYYYMMDD}_1.tar.gz"

This User Gave Thanks to methyl For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with scripts

script that ask for "enter a file name" and removes that file and asks for confirmation before deletion if executed the output might look as enter the filename you intent to deleted remover file? Y file deleterd I knwo the comand I would use find . -name *.* -ok rm {}\; I guess... can... (1 Reply)
Discussion started by: LiTo
1 Replies

2. Shell Programming and Scripting

Calling expect scripts from other expect scripts

Hi, First, let me explain the issue I am trying to solve. We have a lot of expect scripts with the duplicated send/expect commands. So, I'd like to be able to extract the duplicated code into the common scripts that can be used by other scripts. Below is my test where I am trying to call... (0 Replies)
Discussion started by: seva
0 Replies

3. UNIX for Dummies Questions & Answers

Profile scripts versus rc scripts....

what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies

4. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

5. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

6. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

7. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

8. Shell Programming and Scripting

Calling scripts from with scripts

Hi all, I'm wondering if you could give me some advice. I am new to scripting and am getting rather frustrated that i can get my script to call another script if certain criteria is met, via command line, but I cannot get the same script to work thru the cron jobs. My first script monitors... (8 Replies)
Discussion started by: echoes
8 Replies

9. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies
naaagt(1M)																naaagt(1M)

NAME
naaagt - Native Agent Adapter (NAA) SYNOPSIS
priority] logMask] ... DESCRIPTION
The Native Agent Adapter allows third-party SNMP agents to work with the HP SNMP Master Agent The Native Agent Adapter runs as a subagent to the HP SNMP Master Agent. reads the file (see the environment variable, described below), and it registers each object identifier (OID) with See the section. After registration is complete, receives SNMP requests from and forwards them to a non-standard UDP port on the same system (see the envi- ronment variable, described below). also receives SNMP responses from the third-party SNMP agent, which is listening to the non-standard UDP port, and forwards the responses to The third-party SNMP agent must listen to the same non-standard UDP port that sends to not the standard SNMP port number(161). Refer to third-party documentation for instructions on how to accomplish this. The third-party SNMP agent can be started before or after starting Parameters Sets the registration priority. If two subagents register the same OIDs, requests are sent to the subagent with the highest priority or to the subagent with the same priority that was the last to register. The priority range is zero (high) to 255 (low). Default: zero. Causes the Native Agent Adapter to continue to run, even if the HP SNMP Master Agent terminates. When subsequently restarts, will re-establish communica- tion with and re-register its OIDs. This option is recommended if the procedure is used, described below. By default, ter- minates automatically when terminates. Troubleshooting Parameters Displays usage information. Sets the logging mask. may be one of the following names: or Multiple logging options can be specified by repeating the option. Logging data is written to the SNMP log file, Default: Causes to run in foreground. By default, runs in the background. Native Agent Adapter Start-up The Native Agent Adapter start-up procedure may be provided by the vendor of the third-party SNMP agent. Refer to third-party documenta- tion for instructions. The third-party SNMP agent and its Native Agent Adapter can be started and stopped automatically during system start-up and shutdown. This is accomplished by providing a start-up/shutdown script under the directory, with symbolic links to it under an appropriate directory. See the rc(1M) man page for details. See the section for procedures for starting The third-party SNMP agent and its Native Agent Adapter can be started using the command by providing start-up and shutdown scripts under Normally, those scripts are merely symbolic links to the automatic start-up/shutdown script under following the same naming conventions documented in the rc(1M) manual page. These scripts are executed by the command. See the section for procedures for starting The third-party SNMP agent and its Native Agent Adapter can be started by entering commands directly or by executing an arbitrary script. When this approach is used, the option should probably be used because the third-party agent and adapter will not be restarted by the com- mand. The following procedure should be used to start for each third-party agent. o Export which must be set to a unique port number. o Export which must be set to an absolute path name for a third-party-specific file. Create the file; refer to third-party docu- mentation for a list of the OIDs that are instrumented by the third-party SNMP agent. o Export which must be set to the community name to be used in SNMP requests forwarded from to the third-party SNMP agent. This environment variable is required only if the third-party agent is configured to use a community name other than the default ("public"). o Create a unique symbolic link to This makes it convenient to distinguish each Native Agent Adapter in output from the command. Execute the symbolic link to start o Start the third-party SNMP agent, following procedures in the third-party documentation. This can be done before or after start- ing naaCnf File Format The file consists of a list of numeric object identifiers (OIDs), one OID per line. Each OID is a subtree of MIB variables that are instrumented by the third-party SNMP agent. Refer to third-party documentation for the list of OIDs. Blank lines and lines beginning with "#" are treated as comments. Leading and trailing spaces on a line are ignored. The OID can start with an optional period. EXTERNAL INFLUENCES
Environment Variables The absolute path name for the file from which the Native Agent Adapter reads the OIDs to be registered for its third-party SNMP agent. Default (not recommended): The community name that the Native Agent Adapter uses in SNMP requests forwarded to the third-party SNMP agent. Note that this does not have to match any community names accepted by the SNMP Master Agent, which are defined in This environment variable is required only if the standard community name ("public") is not accepted by the third-party SNMP agent. Refer to third-party documenta- tion for instructions regarding SNMP community names. Default: public. The non-standard UDP port number to which the Native Agent Adapter forwards SNMP requests to the third-party SNMP agent. This must match the port number that the third-party agent listens to instead of the standard SNMP port(161). Each third-party SNMP agent must listen to a different non- standard UDP port number. Default: 8161. International Code Set Support Supports single-byte character code sets except where the SNMP protocol supports only 7-bit characters encoded in ASCII. WARNINGS
The Native Agent Adapter only supports SNMP read requests (for example, SNMP Get). SNMP Set requests must be sent directly to the third- party SNMP agent's non-standard UDP port If the value is not a valid port number, terminates without writing any error message either to the display or to If there are no valid OIDs in the file, terminates. It does not register a default OID. There may be unexpected results if the is outside the valid range. AUTHOR
was developed by SNMP Research and Hewlett-Packard Company. FILES
Default file. Not recommended. Directory for SNMP start-up and shutdown scripts. Native Agent Adapter command. HP SNMP Master Agent command. HP SNMP log file. SEE ALSO
rc(1M), snmpd(1M), snmpd.conf(4). naaagt(1M)
All times are GMT -4. The time now is 05:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy