Sponsored Content
Full Discussion: simple script help
Top Forums Shell Programming and Scripting simple script help Post 302161233 by ennstate on Thursday 24th of January 2008 03:57:38 AM
Old 01-24-2008
Quote:
Originally Posted by ali560045
i need to check the dates inside the file by using the command


cat filename | grep date
I couldn't get your question,by the way why "cat filename | grep date" while "grep date filename" can do the same job much efficiently?

Thanks
Nagarajan G
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help with simple script

I need a script that checks to see if ypserv is running, and if not it will restart yp. I have a ypslave that is running Sol9, and the ypsrv daemon is dieing, I want to create a cron job that periodicly checks to see if it's running, and if it see's that it isn't, it will re-start the daemon (1 Reply)
Discussion started by: jdel80
1 Replies

2. Shell Programming and Scripting

Simple Script

Here is the script that i am trying to run. I get an error and i can't figure out what is the problem. #!/bin/bash echo "What is your name" read NAME if ; then echo "My name is the same" esle echo "You have a nice name" fi (11 Replies)
Discussion started by: xplod4202
11 Replies

3. Shell Programming and Scripting

simple script

Hi, I just need a shell script to find out the processes taking longer time...(Unix/Linux) Urgent response needed.. Rajiv (5 Replies)
Discussion started by: rajivn786
5 Replies

4. UNIX for Dummies Questions & Answers

Simple script

I am trying to print my script arguments, but i am stuck at the arrow pointed lines..please help #!/bin/bash echo "Number of arguments $#" count=1 while do echo ${$count} <======================== count = $(expr $count +1) <================== done (4 Replies)
Discussion started by: chvs2000
4 Replies

5. Shell Programming and Scripting

Simple script

I have a script that will check for integer line by line and if it encounter any blank space will echo it: Below the script: #!/bin/ksh while read i do echo "Value is $i" count=`expr substr "$i" 1 3` echo $count if && then echo "Matched" else echo "Blank Space Found" fi (3 Replies)
Discussion started by: ali560045
3 Replies

6. Shell Programming and Scripting

Simple Script to do so?

hi guys, i am a noob to shell scripting, and i would like to run a simple script, that could simply do the following: 1. SFTP to a remote server/path...and download the newest *.gz backup file on that server. (there are many *.gz files in that folder, i simply need the latest one) 2. locally... (1 Reply)
Discussion started by: Confidence
1 Replies

7. Shell Programming and Scripting

Simple Script Can u help please?

I have a file that contains these lines User ID Username -------- ---------- 7738626,zrazak 7783535,jvincigu 7805567,ldrennan 7805583,mtsakama I need to sort the names alphabetically How can I sort the lines based on the user names ? I would appreciate a quick reply anyone ... (1 Reply)
Discussion started by: mnassiri
1 Replies

8. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

9. Linux

How to execute a simple select script using a shell script?

Hi team, I have two select statements and need to run them using SYSDBA user select * from temp_temp_seg_usage; select segment_name, tablespace_name, bytes/ (1024*1024) UsedMb from dba_segments where segment_name='TEMP_TEMP_SEG_USAGE'; Need to run this using a shell script say named... (1 Reply)
Discussion started by: pamsy78
1 Replies

10. Shell Programming and Scripting

Simple if script

Hi, new to unix and scripting, and i'm trying to set up a simple "if" script to create a seperate flag file dependant on success. So far i have the following ($5 is a variable passed to the script from the backup job) if then touch /u03/backups/backup_ended.flag else touch... (13 Replies)
Discussion started by: richs24
13 Replies
Template::Plugin::Date(3)				User Contributed Perl Documentation				 Template::Plugin::Date(3)

NAME
Template::Plugin::Date - Plugin to generate formatted date strings SYNOPSIS
[% USE date %] # use current time and default format [% date.format %] # specify time as seconds since epoch # or as a 'h:m:s d-m-y' or 'y-m-d h:m:s' string [% date.format(960973980) %] [% date.format('4:20:36 21/12/2000') %] [% date.format('2000/12/21 4:20:36') %] # specify format [% date.format(mytime, '%H:%M:%S') %] # specify locale [% date.format(date.now, '%a %d %b %y', 'en_GB') %] # named parameters [% date.format(mytime, format = '%H:%M:%S') %] [% date.format(locale = 'en_GB') %] [% date.format(time = date.now, format = '%H:%M:%S', locale = 'en_GB) %] # specify default format to plugin [% USE date(format = '%H:%M:%S', locale = 'de_DE') %] [% date.format %] ... DESCRIPTION
The "Date" plugin provides an easy way to generate formatted time and date strings by delegating to the "POSIX" "strftime()" routine. The plugin can be loaded via the familiar USE directive. [% USE date %] This creates a plugin object with the default name of '"date"'. An alternate name can be specified as such: [% USE myname = date %] The plugin provides the "format()" method which accepts a time value, a format string and a locale name. All of these parameters are optional with the current system time, default format ('"%H:%M:%S %d-%b-%Y"') and current locale being used respectively, if undefined. Default values for the time, format and/or locale may be specified as named parameters in the "USE" directive. [% USE date(format = '%a %d-%b-%Y', locale = 'fr_FR') %] When called without any parameters, the "format()" method returns a string representing the current system time, formatted by "strftime()" according to the default format and for the default locale (which may not be the current one, if locale is set in the "USE" directive). [% date.format %] The plugin allows a time/date to be specified as seconds since the epoch, as is returned by "time()". File last modified: [% date.format(filemod_time) %] The time/date can also be specified as a string of the form "h:m:s d/m/y" or "y/m/d h:m:s". Any of the characters : / - or space may be used to delimit fields. [% USE day = date(format => '%A', locale => 'en_GB') %] [% day.format('4:20:00 9-13-2000') %] Output: Tuesday A format string can also be passed to the "format()" method, and a locale specification may follow that. [% date.format(filemod, '%d-%b-%Y') %] [% date.format(filemod, '%d-%b-%Y', 'en_GB') %] A fourth parameter allows you to force output in GMT, in the case of seconds-since-the-epoch input: [% date.format(filemod, '%d-%b-%Y', 'en_GB', 1) %] Note that in this case, if the local time is not GMT, then also specifying '%Z' (time zone) in the format parameter will lead to an extremely misleading result. Any or all of these parameters may be named. Positional parameters should always be in the order "($time, $format, $locale)". [% date.format(format => '%H:%M:%S') %] [% date.format(time => filemod, format => '%H:%M:%S') %] [% date.format(mytime, format => '%H:%M:%S') %] [% date.format(mytime, format => '%H:%M:%S', locale => 'fr_FR') %] [% date.format(mytime, format => '%H:%M:%S', gmt => 1) %] ...etc... The "now()" method returns the current system time in seconds since the epoch. [% date.format(date.now, '%A') %] The "calc()" method can be used to create an interface to the "Date::Calc" module (if installed on your system). [% calc = date.calc %] [% calc.Monday_of_Week(22, 2001).join('/') %] The "manip()" method can be used to create an interface to the "Date::Manip" module (if installed on your system). [% manip = date.manip %] [% manip.UnixDate("Noon Yesterday","%Y %b %d %H:%M") %] AUTHORS
Thierry-Michel Barral wrote the original plugin. Andy Wardley provided some minor fixups/enhancements, a test script and documentation. Mark D. Mills cloned "Date::Manip" from the "Date::Calc" sub-plugin. COPYRIGHT
Copyright (C) 2000-2007 Thierry-Michel Barral, Andy Wardley. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Template::Plugin, POSIX perl v5.12.1 2009-06-30 Template::Plugin::Date(3)
All times are GMT -4. The time now is 02:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy