Sponsored Content
Top Forums Shell Programming and Scripting can you design/create a script for this? Post 302317852 by summer_cherry on Wednesday 20th of May 2009 05:58:43 AM
Old 05-20-2009
Code:
while(<DATA>){
	if(/([0-9]+)\s*\(([0-9]+)/){
		print $_ if $2*100/$1 >=20;
	}
}
__DATA__
3 (0 sec, 804275 nanosec) abcd
721 (253 sec, 632655866 nanosec) efgh
1873 (21 sec, 887264375 nanosec) hijk
2006 (0 sec, 922300 nanosec) lmhn
3 (0 sec, 3332 nanosec) sjhfdf
2 (0 sec, 2367 nanosec) dkfi
580 (0 sec, 2138703 nanosec) dfhjf
44486 (0 sec, 858447770 nanosec) oet
21102 (739 sec, 891470054 nanosec) lldff
140 (0 sec, 90282 nanosec) sfowe
123 0 sec, 324590 nanosec) xjjv
8939 (0 sec, 337230856 nanosec) asadj
19 (0 sec, 1455434 nanosec) sahjdi
210 (0 sec, 89131 nanosec) posdio
3 (0 sec, 3750149 nanosec) jhd
873 (260 sec, 715043557 nanosec) lppeuv
16 (0 sec, 212024 nanosec) hjass
13668 (2 sec, 506391927 nanosec) nnuua

 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ksh script - Design ? - Search file and set variables

Hi - I'm trying to think of a clever way to write a shell script (trying to stay w/ ksh as that's what I know the best...) that will resolve the following problem: Problem - On a daily basis I have to email folks who are on-call to remind them. I was hoping to script this out so I could have... (9 Replies)
Discussion started by: littlefrog
9 Replies

2. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies

3. Shell Programming and Scripting

To design a report using shell script

Short Description: To find the core files from a directory for the previous day and e-mail it across to a particular id. 1) Finding the core files in a directory. 2) The time is divided into eight fields and based on the time the respective field should be updated with the flag 1. ... (1 Reply)
Discussion started by: venkatesht
1 Replies

4. Shell Programming and Scripting

Perl Question on How to Design an Effective Script

Hello All, This is my situation and I am new to perl scripting so I am trying to figure out the best way to tackle this problem. I need help in creating the logic to analyze the data. Problem: I need to access an oracle database, gather information from a specific query and then analyze... (0 Replies)
Discussion started by: jacktravine
0 Replies

5. Homework & Coursework Questions

Create script to add user and create directory

first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies

6. Programming

CGI Perl script to execute bash script- unable to create folder

Hi I have a bash script which takes parameters sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash I have... (0 Replies)
Discussion started by: rakeshkumar
0 Replies

7. Shell Programming and Scripting

wrapper script design for gnu ed text editor i/o

Hi. I'm having trouble writing a wrapper script for the command line text editor gnu ed. I want to be able to run the following algorithm on ed: 1. Display, on stdout, a command which I intend to feed into ed (before I actually feed it to ed). 2. Actually feed the command into ed's stdin.... (2 Replies)
Discussion started by: vomv1988
2 Replies

8. Shell Programming and Scripting

Shell script to create runtime variables based on the number of parameters passed in the script

Hi All, I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them abc.sh ---------- export Numbr_Parms=$# export a=1 while do export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
ARCHIVE_ENTRY_TIME(3)					   BSD Library Functions Manual 				     ARCHIVE_ENTRY_TIME(3)

NAME
archive_entry_atime, archive_entry_atime_nsec, archive_entry_atime_is_set, archive_entry_set_atime, archive_entry_unset_atime, archive_entry_birthtime, archive_entry_birthtime_nsec, archive_entry_birthtime_is_set, archive_entry_set_birthtime, archive_entry_unset_birthtime, archive_entry_ctime, archive_entry_ctime_nsec, archive_entry_ctime_is_set, archive_entry_set_ctime, archive_entry_unset_ctime, archive_entry_mtime, archive_entry_mtime_nsec, archive_entry_mtime_is_set, archive_entry_set_mtime, archive_entry_unset_mtime, -- functions for manipulating times in archive entry descriptions LIBRARY
Streaming Archive Library (libarchive, -larchive) SYNOPSIS
#include <archive_entry.h> time_t archive_entry_atime(struct archive_entry *a); long archive_entry_atime_nsec(struct archive_entry *a); int archive_entry_atime_is_set(struct archive_entry *a); void archive_entry_set_atime(struct archive_entry *a, time_t sec, long nanosec); void archive_entry_unset_atime(struct archive_entry *a); time_t archive_entry_birthtime(struct archive_entry *a); long archive_entry_birthtime_nsec(struct archive_entry *a); int archive_entry_birthtime_is_set(struct archive_entry *a); void archive_entry_set_birthtime(struct archive_entry *a, time_t sec, long nanosec); void archive_entry_unset_birthtime(struct archive_entry *a); time_t archive_entry_ctime(struct archive_entry *a); long archive_entry_ctime_nsec(struct archive_entry *a); int archive_entry_ctime_is_set(struct archive_entry *a); void archive_entry_set_ctime(struct archive_entry *a, time_t sec, long nanosec); void archive_entry_unset_ctime(struct archive_entry *a); time_t archive_entry_mtime(struct archive_entry *a); long archive_entry_mtime_nsec(struct archive_entry *a); int archive_entry_mtime_is_set(struct archive_entry *a); void archive_entry_set_mtime(struct archive_entry *a, time_t sec, long nanosec); void archive_entry_unset_mtime(struct archive_entry *a); DESCRIPTION
These functions create and manipulate the time fields in an archive_entry. Supported time fields are atime (access time), birthtime (cre- ation time), ctime (last time an inode property was changed) and mtime (modification time). libarchive(3) provides a high-resolution interface. The timestamps are truncated automatically depending on the archive format (for archiv- ing) or the filesystem capabilities (for restoring). All timestamp fields are optional. The XXX_unset() functions can be used to mark the corresponding field as missing. The current state can be queried using XXX_is_set(). Unset time fields have a second and nanosecond field of 0. SEE ALSO
archive(3), archive_entry(3) HISTORY
The libarchive library first appeared in FreeBSD 5.3. AUTHORS
The libarchive library was written by Tim Kientzle <kientzle@acm.org>. BSD
February 2, 2012 BSD
All times are GMT -4. The time now is 12:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy