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
Korne Shell Script... marconi Shell Programming and Scripting 5 12-06-2007 08:08 PM
Korne Shell... marconi Shell Programming and Scripting 1 12-06-2007 11:01 AM
Some Problem with Korne Shell// marconi Shell Programming and Scripting 4 12-06-2007 07:57 AM
GOTO LOOP in KORNE SHELL DeepakXavier Shell Programming and Scripting 1 11-10-2005 09:47 AM
Mailing in Korne shell DeepakXavier Shell Programming and Scripting 5 10-09-2005 01:27 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-05-2007
Registered User
 

Join Date: Dec 2007
Posts: 41
Korne Shell Problem.

Hi Everyone,

I have tried with the following Code for each of the following, but that does not seem to serve the purpose. Can someone give some pointers please.

1) A Korne Shell which asks the user to enter the name of a file when searching it
recursively (using the find command) in the home directory of this user.

#!/usr/bin/ksh
find * -type f -type d -path usr
if [ –a file ]
then
echo -n "Enter the file name"
fi


2) A Korne Shell which asks the user for a date (format AAMMJJ) and a directory and
then searches recursively in this directory the list of files modified after the date
chosen.

#!/usr/bin/ksh
if ['-d $1'+ 'date -t "%AA%MM%JJ"']
then
echo -n "find all files modified after the chosen date"
touch ' new date -nt "%AA%MM%JJ"
find * -type f -type new date

Thanks,
Marconi.
Forum Sponsor
  #2  
Old 12-05-2007
awk awk is offline
Registered User
 

Join Date: Feb 2007
Posts: 120
see Simple rules of the UNIX.COM forums:

#4 & #6
  #3  
Old 12-05-2007
Registered User
 

Join Date: Dec 2007
Posts: 41
Hi,

Pls have a look at what I posted clearly.
I have asked for some pointers after trying it and not the actual code.

Thanks,
Marc
  #4  
Old 12-05-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by marconi View Post
find * -type f -type d -path usr
That looks awful.

I thought you would be doing...

Code:
...
echo "Enter filename...."
read WANTED
find "$HOME" -type f -name "$WANTED"
The first argument to find should be directory to search in, the wildcard is a blunderbuss that will pickup all kinds of debris.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:23 AM.


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