Sponsored Content
Top Forums Shell Programming and Scripting A newbie with a problem in A date Script Post 302089195 by mercy on Monday 18th of September 2006 04:36:50 AM
Old 09-18-2006
Which OS do you use?

for freebsd you can replace
Quote:
d=`date '+%d'`
d=`/usr/bin/expr $d - 1`
by d=`date -v -1d +%d`
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Newbie problem with ksh script

Hi all, I have a directory have all of the .stat and .dat file : they are is a pipe separate flat file. Example: log-20061202.stat contain 1st line and last line of log-20061202.dat with record count of that day. Example: Total record = 240 Tom|02-12-2006|1600 W.Santa... (18 Replies)
Discussion started by: sabercats
18 Replies

2. Shell Programming and Scripting

Newbie convert date ksh

If I have start = 02282006; end = 03152006; How do I get startdate = 02/28/2006; enddate = 03/15/2006; Thanks, (3 Replies)
Discussion started by: britney
3 Replies

3. Shell Programming and Scripting

Please help - newbie (date)

Hi I need help to write a script to do following: Sample Input file1: 07-01-08 08:48:07:982 INFO .... 07-01-08 08:49:07:982 DETAIL ..... 07-01-08 08:50:14:982 INFO ..... 07-01-08 08:51:23:982 DETAIL ..... 07-01-08 08:52:57:982 INFO ..... 07-01-08 08:53:01:982 DETAIL ..... 07-01-09... (1 Reply)
Discussion started by: mel_2008
1 Replies

4. Shell Programming and Scripting

Newbie problem with simple script to create a directory

script is: dirname= "$(date +%b%d)_$(date +%H%M)" mkdir $dirname should create a directory named Nov4_ Instead I get the following returned: root@dchs-pint-001:/=>./test1 ./test1: Nov04_0736: not found. Usage: mkdir Directory ... root@dchs-pint-001:/=> TOO easy, but what am I... (2 Replies)
Discussion started by: gwfay
2 Replies

5. Shell Programming and Scripting

Problem - script that parses $date data...

This is probably archaic, but I'm new to unix and this is my first shell script. I'm writing this script to use in another script. All I am trying to do is make the parts of the output from date usable in my other script. I was wondering if you could stand looking at this and see if you notice... (8 Replies)
Discussion started by: Dalcron
8 Replies

6. UNIX for Dummies Questions & Answers

Date Script problem for year cross over

Hello, I'm very new to script writing - everything I have I got off the Internet. I'm pretty sure I stole this date script from this site. Anyway, the script works great until I try to obtain a date that falls into last year. I can get 'Dec 31, 2009' but nothing earlier. Below is the... (3 Replies)
Discussion started by: Colel2
3 Replies

7. Programming

Date time problem while executing perl script.

Hi All, This Monday 15th March 2010, i have faced a weired issue with my Perl script execution, this script is scheduled to run at 1 minute past midnight on daily basis ( 00:01 EST ) generally for fetching previous business date , say if it is Monday it should give last Friday date, for Tuesday... (0 Replies)
Discussion started by: ravimishra
0 Replies

8. Shell Programming and Scripting

php date script problem

i want to store the output of date into a variable and be able to echo out that variable in a sentence. but the below isn't working. <?php #$date_time = date('Y-m-d H:i:s'); putenv("TZ=US/Eastern"); date_time = "date('h:i:s')."\n""; echo ("<li>Today's date is: ($date_time)</li>\n"); ... (1 Reply)
Discussion started by: SkySmart
1 Replies

9. Shell Programming and Scripting

Shell script newbie, what is problem with my script?

Hello, Ubuntu server 11.10 can anybody help what is problem with my shell script? #!/bin/bash #script to find out currently logged on user is root or not. if ] then echo "You are super" else echo "You are awesome!" fi When I run script, I get following output ./uid: line 3: I... (4 Replies)
Discussion started by: kaustubh
4 Replies

10. Shell Programming and Scripting

Problem with date on bash script

i am beginner in bash scripting and i am looking for a command that gives me one minute ago. i am working on unix ware7 and i cant use date -d or date --date command thanks for help !! (4 Replies)
Discussion started by: rezasadeghi
4 Replies
SYSSTAT(5)							Linux User's Manual							SYSSTAT(5)

NAME
sysstat - sysstat configuration file. DESCRIPTION
This file is read by sa1(8) and sa2(8) shell scripts from the sysstat's set of tools. It consists of a sequence of shell variable assign- ments used to configure sysstat logging. The variables and their meanings are: HISTORY The number of days during which a daily data file or a report should be kept. Data files or reports older than this number of days will be removed by the sa2(8) shell script. COMPRESSAFTER Number of days after which daily data files are to be compressed, either by gzip or bzip2. SADC_OPTIONS Options that should be passed to sadc(8). With these options (see sadc(8) manual page), you can select some additional data which are going to be saved in daily data files. These options are used only when a new data file is created. They will be ignored with an already existing one. FILES
/etc/sysconfig/sysstat AUTHOR
Sebastien Godard (sysstat <at> orange.fr) SEE ALSO
sadc(8), sa1(8), sa2(8) http://pagesperso-orange.fr/sebastien.godard/ Linux SEPTEMBER 2010 SYSSTAT(5)
All times are GMT -4. The time now is 02:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy