Sponsored Content
Full Discussion: sed convert date/replace
Top Forums Shell Programming and Scripting sed convert date/replace Post 302816513 by snayper on Tuesday 4th of June 2013 05:35:10 AM
Old 06-04-2013
@vidyadhar85

Thanks Master!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

convert Julian date to calender date

Hi, I have script in unix which creates a julian date like 126 or 127 I want convert this julian date into calender date ex : input 127 output 07/may/2007 or 07/05/2007 or 07/05/07 rgds srikanth (6 Replies)
Discussion started by: srikanthus2002
6 Replies

2. Shell Programming and Scripting

Using sed command replace date variable in unix

I need to use a shell script, using sed command how to replace date variable value in following format. 04/18/2012 11:38:55 Because the sed is treating the '/' as a parameter instead of the value of a variable, and hence there is the message as sed: command garbled: s/insert/04/18/2012... (9 Replies)
Discussion started by: jannusuresh
9 Replies

3. UNIX for Dummies Questions & Answers

Unable to convert date into no. using date -d +%s syntax in ksh shell

hi friends, I m trying to write a script which compares to dates. for this i am converting dates into no using synatx as below v2=`date | awk '{print $2,$3,$4}'` v3=`date +%s -d "$v2"` this syntax is working in bash shell ,but fails in ksh shell. please suggest on this. (12 Replies)
Discussion started by: Jcpratap
12 Replies

4. Shell Programming and Scripting

Convert date arg to sql date

Doing a bcp load to sybase and need to convert datearg which comes in as 20130501 to 2013-05-01 which is the best way to do this (4 Replies)
Discussion started by: tasmac
4 Replies

5. Shell Programming and Scripting

sed command to replace slash in date format only

Hello experts. I haven't been able to find a solution for this using the sed command. I only want to replace the forward slash with string "FW_SLASH" only if there's a number right after the slash while preserving the original number. I have a file containing 2 entries: Original File:... (5 Replies)
Discussion started by: pchang
5 Replies

6. Shell Programming and Scripting

[Solved] sed - how replace date in script

Hi All, I have a requirement to find and replace old date with new date value. Below is the scenario: # In the input file, date is MM/DD/YYYY format PREV_DTE=09/15/2013 I want to replace with 09/30/2013. It should look like PREV_DTE=09/30/2013 I am using below sed command :... (4 Replies)
Discussion started by: rockygsd
4 Replies

7. Shell Programming and Scripting

Convert a date stored in a variable to epoch date

I am not able to pass date stored in a variable as an argument to date command. I get current date value for from_date and to_date #!/usr/bin/ksh set -x for s in server ; do ssh -T $s <<-EOF from_date="12-Jan-2015 12:02:09" to_date="24-Jan-2015 13:02:09" echo \$from_date echo... (7 Replies)
Discussion started by: raj48
7 Replies

8. Shell Programming and Scripting

Sed/awk command to convert number occurances into date format and club a set of lines

Hi, I have been stuck in this requirement where my file contains the below format. 20150812170500846959990854-25383-8.0.0 "ABC Report" hp96880 "4952" 20150812170501846959990854-25383-8.0.0 End of run 20150812060132846959990854-20495-8.0.0 "XYZ Report" vg76452 "1006962188"... (6 Replies)
Discussion started by: Chinmaya Kabi
6 Replies

9. UNIX for Beginners Questions & Answers

How to replace a parameter(variable) date value inside a text files daily with current date?

Hello All, we what we call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to... (1 Reply)
Discussion started by: pradeepp
1 Replies
SSAAgentIsAlive(3SNMP)					      SNMP Library Functions					    SSAAgentIsAlive(3SNMP)

NAME
SSAAgentIsAlive, SSAGetTrapPort, SSARegSubtable, SSARegSubagent, SSARegSubtree, SSASendTrap, SSASubagentOpen - Sun Solstice Enterprise Agent registration and communication helper functions SYNOPSIS
cc [ flag ... ] file ... -lssagent -lssasnmp [ library .. ] #include <impl.h> extern int SSAAgentIsAlive(IPAddress *agent_addr, int *port, char *community, struct timeval *timeout); extern int SSAGetTrapPort(); extern int *SSARegSubagent(Agent* agent); int SSARegSubtable(SSA_Table *table); int SSARegSubtree(SSA_Subtree *subtree); extern void SSASendTrap(char *name); extern int SSASubagentOpen(int *num_of_retry, char *agent_name); DESCRIPTION
The SSAAgentIsAlive() function returns TRUE if the master agent is alive, otherwise returns FALSE. The agent_addr parameter is the address of the agent. Specify the security token in the community parameter. You can specify the maximum amount of time to wait for a response with the timeout parameter. The SSAGetTrapPort() function returns the port number used by the Master Agent to communicate with the subagent. The SSARegSubagent() function enables a subagent to register and unregister with a Master Agent. The agent parameter is a pointer to an Agent structure containing the following members: int timeout; /* optional */ int agent_id; /* required */ int agent_status; /* required */ char *personal_file; /* optional */ char *config_file; /* optional */ char *executable; /* optional */ char *version_string; /* optional */ char *protocol; /* optional */ int process_id; /* optional */ char *name; /* optional */ int system_up_time; /* optional */ int watch_dog_time; /* optional */ Address address; /* required */ struct _Agent; /* reserved */ struct _Subtree; /* reserved */ The agent_id member is an integer value returned by the SSASubagentOpen() function. After calling SSASubagentOpen(), you pass the agent_id in the SSARegSubagent() call to register the subagent with the Master Agent. The following values are supported for agent_status: SSA_OPER_STATUS_ACTIVE SSA_OPER_STATUS_NOT_IN_SERVICE SSA_OPER_STATUS_DESTROY You pass SSA_OPER_STATUS_DESTROY as the value in a SSARegSubagent() function call when you want to unregister the agent from the Master Agent. Address has the same structure as sockaddr_in, that is a common UNIX structure containing the following members: short sin_family; ushort_t sin_port; struct in_addr sin_addr; char sin_zero[8]; The SSARegSubtable() function registers a MIB table with the Master Agent. If this function is successful, an index number is returned, otherwise 0 is returned. The table parameter is a pointer to a SSA_Table structure containing the following members: int regTblIndex; /* index value */ int regTblAgentID; /* current agent ID */ Oid regTblOID; /* Object ID of the table */ int regTblStartColumn; /* start column index */ int regTblEndColumn; /* end column index */ int regTblStartRow; /* start row index */ int regTblEndRow; /* end row index */ int regTblStatus; /* status */ The regTblStatus can have one of the following values: SSA_OPER_STATUS_ACTIVE SSA_OPER_STATUS_NOT_IN_SERVICE The SSARegSubtree() function registers a MIB subtree with the master agent. If successful this function returns an index number, otherwise 0 is returned. The subtree parameter is a pointer to a SSA_Subtree structure containing the following members: int regTreeIndex; /* index value */ int regTreeAgentID; /* current agent ID */ Oid name; /* Object ID to register */ int regtreeStatus; /* status */ The regtreeStatus can have one of the following values: SSA_OPER_STATUS_ACTIVE SSA_OPER_STATUS_NOT_IN_SERVICE The SSASendTrap() function instructs the Master Agent to send a trap notification, based on the keyword passed with name. When your sub- agent MIB is compiled by mibcodegen, it creates a lookup table of the trap notifications defined in the MIB. By passing the name of the trap notification type as name, the subagent instructs the Master Agent to construct the type of trap defined in the MIB. The SSASubagentOpen() function initializes communication between the subagent and the Master Agent. You must call this function before calling SSARegSubagent() to register the subagent with the Master Agent. The SSASubagentOpen() function returns a unique agent ID that is passed in the SSARegSubagent() call to register the subagent. If 0 is returned as the agent ID, the attempt to initialize communication with the Master Agent was unsuccessful. Since UDP is used to initialize communication with the Master Agent, you may want to set the value of num_of_retry to make multiple attempts. The value for agent_name must be unique within the domain for which the Master Agent is responsible. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) SunOS 5.10 17 Dec 1996 SSAAgentIsAlive(3SNMP)
All times are GMT -4. The time now is 09:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy