Sponsored Content
Full Discussion: Script requirement
Top Forums UNIX for Dummies Questions & Answers Script requirement Post 302958700 by Don Cragun on Sunday 25th of October 2015 03:47:56 PM
Old 10-25-2015
Is this a homework assignment? Homework assignments must be posted in the Homework & Coursework Forum and must include a completely filled out homework & coursework template.

When asking questions in these forums, it is always a good idea to tell us what operating system and shell you are using.

For questions concerning the handling of dates and times, it is crucial. Date processing on some systems is MUCH simpler than it is on some other systems. What operating system are you using?

What shell are you using? (And, if it is a Korn shell (ksh), what version is it?)

And, if you can't give us an example of what output you're trying to produce from your sample input (and a specific date and time at which the script is run), I don' see how we can help.

I have never seen a script that would be able to send an e-mail message to someone and force the recipient of that e-mail to send that message to a physical printer. I'm guessing that that isn't really what you mean, but that is what your description requires.

There are LOTS of things missing from these requirements that make creating a script for this impossible:
  1. What date applies to lines that don't have dates on them? Is it the current date? Is it the date specified on the first line before it that contains a date? Is it the date specified on the first line after it that contains a date?
  2. What year is associated with dates in column 2? Is it the current year if the date on that line is less than or equal to the current date and the previous year if the date on that line is greater than the current date? Is it always in the current year?
  3. In the requirement: "Now I need a script to add column 2nd and column 3rd entries and compare it with current time( HH:MM format) and if it exceeds more than 15 min then I should get all such column A entries printed in email body.", what does all such column A entries mean? All lines that contain the string contained in column 1? All lines that contain the string contained in column 1 in column 1? Just print column 1 from lines where column 2 + column 3 + 15 minutes is earlier in the day than the current time in the current day? Please give us a clear specification of what you are trying to do!
There are other ambiguities in your requirements. Please write clear requirements and show us examples (in CODE tags) that highlight how those requirements affect the output you're trying to produce.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Required Shell script for My requirement

Hi All, I joined today in this forum to have all of your help. I have a Big requirement, pls. help me to resolve. I'm using HP-UX 11.23. I need a shell script for the following requirement. I have a file (nodes.txt) that contains 1000 nodes. I'm running the following command:... (3 Replies)
Discussion started by: ntgobinath
3 Replies

2. Shell Programming and Scripting

Requirement

I am trying to script and came up with a conclusion that I need a do while loop in my statement. I am stuck with the do while syntax. I need to use it alongwith the if then else statement. Can I use it is a big question? I actually need to get all the files that are there from within run_dt to... (1 Reply)
Discussion started by: aronmelon
1 Replies

3. Shell Programming and Scripting

Awk script with a urgent requirement

The Problem content is pin (AND1) { dir : output; cap : hot; tran: slew; } need to write a awk script which can search the Pin AND1 and then tran of the Group pin(AND1) and then insert the code from the file "insert_code" . insert_code file contents . It is a Big file the script should... (3 Replies)
Discussion started by: kshitij
3 Replies

4. Shell Programming and Scripting

complex requirement

i have a requirement to search a pattern1 and once the pattern1 is found i have to go up and search pattern2 and if pattern2 is found i have to search down for pattern3 and pattern4. once this cycle is compelted, again i have to search pattern1 and pattern2,3,4 i am able to do this by opening... (9 Replies)
Discussion started by: tnvanathy23
9 Replies

5. Shell Programming and Scripting

How to write bash shell script for mentioned requirement?

Hi All, I am unable to write the script for the below requirement. Requirement: Main table dir_ancillary table contain three column "dir_ancillary.table_name"," dir_ancillary.text_file_name ", "dir_ancillary.Include" . This dir_ancillary contain undefined tables in the column... (2 Replies)
Discussion started by: Vineeta Nigam
2 Replies

6. Shell Programming and Scripting

UNIX - requirement

Hi All, I have a source file with data Name ~ Groups Muni~abc,was,USA_ax,123 Chaitanya~USA_12,was Balaji~123,xyz,was Ramu~123,xyz From the second column i want to extract only the groups that matches the pattern 'USA_%' or if the group = 'was', and ignore any other columns. ... (8 Replies)
Discussion started by: morbid_angel
8 Replies

7. Shell Programming and Scripting

Help to write a script for the below requirement

Hi, I am not so familiar with shell Script but I have a task in hand. So, here it goes: There is a file details.txt in the server where the below details are stored: Name Country D M Acc.No. sameer India 30 july sscc-errttt-q random US 20 july pecc-ttt4-s Deb India 31... (3 Replies)
Discussion started by: neel87
3 Replies

8. Shell Programming and Scripting

Writing if condition in shell script and failing to do requirement

Hi, I am trying to edit the values in a file. For example i am trying to edit the value of "ABC" in a file by executing shell script. Please Note that ABC value can be there mulitple times or it may not be there in the file Conditions for it is 1. If ABC is less than 123 then it should... (14 Replies)
Discussion started by: darling
14 Replies
AMANDA-SCRIPTS(7)						    Miscellanea 						 AMANDA-SCRIPTS(7)

NAME
amanda-scripts - Configuring and using the Script API DESCRIPTION
The Script API is a flexible system for invoking user-supplied scripts at various points in the execution of Amanda. This manual page describes the operation and configuration of the API. For help writing Script API scripts, see http://wiki.zmanda.com/index.php/Script_API. SCRIPTS
This section lists the scripts included with Amanda, see the individual man page for instructions on using them. For complete How-To information, consult the Amanda wiki at http://wiki.zmanda.com. o amzfs-snapshot(8), - create/destroy zfs snapshot. o script-email(8), - send email. Script properties work just like application properties: they are insensitive to case, and - (dash) and _ (underscore) may be used interchangeably. SCRIPTS OUTPUT PROPERTY
A pre-dle-amcheck, pre-dle-estimate or pre-dle-backup executed on the client can output property on stdout that are sent to the application. If the output line matches "PROPERTY str1 str2", Amanda sets a property called "str1" by the value of "str2", that property is sent to the application. SEE ALSO
amanda(8), amanda.conf(5) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHORS
Jean-Louis Martineau <martineau@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Dustin J. Mitchell <dustin@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Amanda 3.3.1 02/21/2012 AMANDA-SCRIPTS(7)
All times are GMT -4. The time now is 04:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy