The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help me in sending parameters from sqlplus script to unix shell script Hara Shell Programming and Scripting 2 01-29-2008 12:31 PM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 12:06 AM
here document to automate perl script that call script hogger84 Shell Programming and Scripting 3 10-22-2007 07:15 AM
returning to the parent shell after invoking a script within a script gurukottur Shell Programming and Scripting 5 09-26-2006 04:05 AM
return valuse from child script to parent script borncrazy Shell Programming and Scripting 1 08-20-2004 12:39 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-28-2006
Registered User
 

Join Date: Mar 2006
Posts: 1
help with script...

hi, i am in college and taking a unix class. i have a project due next week and just wanted some help with it. i figured thsi would be a good place to ask. so here goes...

i'm going to post my pseudocode right now, and ill put up my codes right after...so

Code:
#! /usr/bin/sh

#---------------------------------------#
#                                       #
# Project 1                             #
#                                       #
# Lists all files from the              #
#       current directory that          #
#       match a specified pattern &     #
#       are newer, older, or the same   #
#       as a given date                 #
#                                       #
#---------------------------------------#

#---------------------------------------#
#                                       #
# Get the search pattern                #
#                                       #
#---------------------------------------#

#---------------------------------------#
#                                       #
# Get the date in the form mm dd yyyy   #
#                                       #
#---------------------------------------#

#---------------------------------------#
#                                       #
# Get the flag    1 = newer than        #
#                 2 = older than        #
#                 3 = same as           #
#                                       #
#---------------------------------------#

#---------------------------------------#
#                                       #
# Send the pattern output to a file     #
#                                       #
#---------------------------------------#

ls -ld etc ...

#---------------------------------------#
#                                       #
# Write a marker at the end of file     #
#                                       #
#---------------------------------------#

THIS PART IS OPTIONAL, AS SHOWN BY EXAMPLES IN CLASS

#---------------------------------------#
#                                       #
# Remaining input comes from the file   #
#                                       #
#---------------------------------------#

#---------------------------------------#
#                                       #
# Display proper heading                #
#                                       #
#---------------------------------------#

#---------------------------------------#
#                                       #
# Loop to process file lines            #
#                                       #
#---------------------------------------#

read 9 things

while [  ]
do
        #---------------------------------------#
        #                                       #
        # Determine time (1) or year (2)        #
        #                                       #
        #---------------------------------------#

        case 

              Need to test for colon

        esac

        #---------------------------------------#
        #                                       #
        # Translate character month to integer  #
        #                                       #
        #---------------------------------------#

        12-part if

        #---------------------------------------#
        #                                       #
        # Compute correct year                  #
        #                                       #
        #---------------------------------------#

        if [ no colon in YearOrTime ]
             then
                 Year=$YearOrTime
        else
                 CurrentYear=`date '+%Y'`
                 CurrentMonth=`date '+%m'`
      
                 if [ $CurrentMonth between 1 and 6 ]
                      then 
                          if [ $Month between 7 and 12 ]
                               then
                                   Year=$CurrentYear
                                   Year=`expr $Year - 1`
                          else
                                   Year=$CurrentYear
                          fi

                 else
                                   Year=$CurrentYear
                 fi
        fi

        #---------------------------------------#
        #                                       #
        # Identify files newer (1) or older (2) # 
        #          for processing               #
        #                                       #
        #---------------------------------------#

        if [ looking for newer than ]
             then

        elif [ looking for older than ]
             then
                     
        else (this is the 'same as' part)

        fi

        read 9 new things

        #---------------------------------------#
        #                                       #
        # Existence test                        #
        #                                       #
        #---------------------------------------#

        THIS PART IS OPTIONAL, AS SHOWN BY EXAMPLES IN CLASS

done

#---------------------------------------#
#                                       #
# Remove the output file                #
#                                       #
#---------------------------------------#
....give me 15mins and ill show you what i have. anyone who can help i'd greatly apperciat your help !! thanks again -- justin
Reply With Quote
Forum Sponsor
  #2  
Old 03-28-2006
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
See number 6
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0