obtaining a particular day


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting obtaining a particular day
# 1  
Old 07-26-2006
obtaining a particular day

hello guys am totally new to this script programming so help me
i want to write a script that obtain a particular day and schedule a task that day at particular time .. my problem is i don't know to get time and particular day in script ...

2.
how i ll print the time taken by executing a command in shell script


#. how i ll check that letter is in small casr or in capital case

plz let me know this

thankx
# 2  
Old 07-26-2006
To check letter if its capital or small:
Code:
#! /bin/ksh
letter=A
if [[ $letter == [a-z] ]]; then
    echo "small"
else
    echo "CAPITAL"
fi

Regards,
Tayyab
# 3  
Old 07-26-2006
Date stamp:

format:
#!/bin/ksh

DAY=`date +%y%m%d`

When you echo $DAY, the output is 060726

When you want to add a TIMESONE to your DAY stamp, you will need to do the following:

first, on command line type the command "date"...This will show you your time zone

In you DAY string, change it to the following:
DAY=`TZ=GMT date +%y%m%d`

Now you can start playing around with the DAY parameter...You can go ahead a day or two, or backwards....

example:
DAY=`TZ=GMT+24 date +%y%m%d`

Output:
060725

The + will take you back....If you specify a -, it will take you forward...

Regards
Henk
Henk Trumpie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Move the files between Current day & a previous day

Hi All, I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day. i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies

2. Shell Programming and Scripting

Obtaining day before a given date

Hi all, is there a way using GNU (Solaris 8) methods of obtaining the day before a given day? i.e. 2007-09-09.... I would like the date a day before it so output would be 2007-09-08. Format YYYY-MM-DD I know I can subtract the day number using cut and expr but it would get tricky if the... (3 Replies)
Discussion started by: muay_tb
3 Replies

3. Shell Programming and Scripting

Script to find previous month last day minus one day timestamp

Hi All, I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this. My Requirment is as below: Input for me will be 2000909(YYYYMM) I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies

4. IP Networking

Obtaining IP address from both my network interface

HI folks, I am developing a software which one of the module is to interchange the ip address of another active network interface's when making a socket connection. I would like to know whether there is any function call that would enable me to retrieve the ip address that is obtained by a... (2 Replies)
Discussion started by: citiz3n
2 Replies

5. Shell Programming and Scripting

Write a shell script to find whether the first day of the month is a working day

Hi , I am relatively new to unix... Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell.. This is very urgent. Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies

6. What is on Your Mind?

Obtaining Security Clearance

I'm looking to move down to the Baltimore, MD area and have been looking for a job for about a week. Many of the opportunities require some form of security clearance, because many of the jobs are government work. My question is how do I go about obtaining the proper clearance? I'm a U.S.... (6 Replies)
Discussion started by: dangral
6 Replies

7. Programming

Obtaining Process information on AIX

I have written a program to collect some performance metrics on and AIX box, but I'm having difficultly getting the process information. I'm lead to believe that I'm not getting the correct information because I'm trying to run the program on AIX 5.1 (5100-03), but I'm not convinced as the... (0 Replies)
Discussion started by: StuBob
0 Replies

8. UNIX for Advanced & Expert Users

Obtaining A Process ID (PID)

Is there any way I can get UNIX to return the Process ID of a process when I actually issue the command to invoke the process? For example, if I was to launch an emacs process in batch mode, by issuing the UNIX command : % emacs file.txt& then UNIX would return the Process ID (PID).... (7 Replies)
Discussion started by: 1cuervo
7 Replies

9. IP Networking

Obtaining IP address

How can UNIX systems obtain IP addresses? Can it obtain from Win 2000 Server, DHCP service, dynamically? (1 Reply)
Discussion started by: Raael
1 Replies
Login or Register to Ask a Question