The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with find command when used with mtime arunkumar_mca UNIX for Dummies Questions & Answers 4 01-08-2008 12:37 AM
result of find mpang_ Shell Programming and Scripting 1 05-01-2006 11:00 PM
Setting a variable to result of FIND command JP Favara Windows & DOS: Issues & Discussions 2 03-09-2005 10:17 PM
find command not returning any result rraajjiibb UNIX for Advanced & Expert Users 4 07-23-2004 05:05 PM
Problem with find command nattynatty Shell Programming and Scripting 7 05-16-2002 12:16 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-06-2008
frenchwill frenchwill is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 3
Question sh : Problem with the result of a find command

Hi
I'm working on solaris and I'm trying to run a script. The part listed here does not work properly, the result of the find command is not in the output
file /tmp/result
(I've checked the find command , executing the shell with sh -x , it seems correct). It seems like I've lost the standard output somewhere
If anyone could help, Thanks !!

(the file /tmp/list_day contains one date per line, YYMMDD)

#!/bin/sh
requete=""
for ligne in `cat /tmp/list_day`
do
if [ "$requete" = "" ]; then
requete="$requete -name \"*$ligne.txt*\""
else
requete="$requete -o -name \"*$ligne.txt*\""
fi
done

find . $requete -print | tee /tmp/result
  #2 (permalink)  
Old 08-06-2008
MikaBaghinen MikaBaghinen is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 11
Can you try this pls.:


if [ "$requete" = "" ]
then
requete="-name \*$ligne.txt\*"
else
requete="$requete -o -name \*$ligne.txt\*"
fi


Au revoir

;-)

Mika

###
  #3 (permalink)  
Old 08-06-2008
ynilesh's Avatar
ynilesh ynilesh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore, India.
Posts: 222
Quote:
The part listed here does not work properly, the result of the find command is not in the output file /tmp/result
Are you trying to redirect command output to /tmp/result. If yes then you can simply use redirect operator (>).

- nilesh
  #4 (permalink)  
Old 08-07-2008
frenchwill frenchwill is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 3
Mika> I've tried, same result...
ynilesh> I've tried both simple redirection (>) and tee command but in both cases, there is nothing in the result file
  #5 (permalink)  
Old 08-07-2008
frenchwill frenchwill is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 3
Solution found :
eval find . $requete -print | tee /tmp/result
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0