Problem wind find file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem wind find file
# 1  
Old 09-18-2007
Problem wind find file

Hello,
I have a problem. I use the following istruction:
ls -lrt Invoice_Line_Items* | awk '{print $9}' > ${lflfile_list}

for insert the name by all file the start with "Invoice_Line_Items", but when the directory don't have this file I have the following messagge error:
"0653-341 The file Invoice_Line_Items* does not exist" and the script don't finish with error. It's possible don't get out messagge?

Thanks for the information,
Luca

PS: I use Korn shell in and the machine is IBM AIX 5L.
# 2  
Old 09-18-2007
Quote:
Originally Posted by lpelo2000
ls -lrt Invoice_Line_Items* | awk '{print $9}' > ${lflfile_list}

Code:
ls -lrt Invoice_Line_Items* 2> /dev/null | awk '{print $9}' > ${lflfile_list}

# 3  
Old 09-18-2007
Quote:
Originally Posted by vino
Code:
ls -lrt Invoice_Line_Items* 2> /dev/null | awk '{print $9}' > ${lflfile_list}

Thanks!
Luca
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with find command "find: cannot open"

Hello Guys , I am trying to run below find command in one of my SH script on a HP UX machine. find /tmp -type f -name "MGCA*.log" -prune -exec rm -f {} \; 2>&1 I want this to check my tmp directory and delete MGCA log files .But below error message is printed on Promt :- find: cannot... (2 Replies)
Discussion started by: himanshu sood
2 Replies

2. Shell Programming and Scripting

wanted to find both link file and ordinary file using single find command

find . -type fl o/p is only the ordinary file. where in it wont give the link files. (2 Replies)
Discussion started by: nikhil jain
2 Replies

3. Shell Programming and Scripting

Problem with Find and rename file

I want to find a file say IIFT and check its size is zero or not. If its zero then I have to rename anothe file say WWFT , which is in another folder to WWFT$Todaysdate. I tried below command: cd dir2 (*File WWFT is in dir2) find dir/ -type f -name 'IIFT*' -size 0 -exec mv WWFT... (3 Replies)
Discussion started by: ammbhhar
3 Replies

4. Shell Programming and Scripting

C Shell problem: using a key from one file to find data in another

I've never written scripts (just switched from Ada to C++). I have a book that's over my head and a few examples, other then that I'm floundering. Everything here at work is being done in C Shell. None of the C++ programmers are experienced in shell scripting. I have a data file with the... (2 Replies)
Discussion started by: bassmaster
2 Replies

5. Shell Programming and Scripting

FTP problem to find file

Hi everybody, i suddenly got in a requirement whereby: I have to create a script whereby I need to connect with a remote server with a FTP script and search whether a file named filename.txt or *.txt exists or not in the remote server. If it exists then my script has to return a value. ... (18 Replies)
Discussion started by: RubinPat
18 Replies

6. UNIX for Dummies Questions & Answers

Problem executing find file command in Linux

When trying to find a list of files with specific text in them using find . -type f -exec grep -l "DataStage Job 4263" {}\; I get error find: missing argument to 'exec' How can I correct this ? I'm on Linux Red Hat. Cheers PS I'm a DataStage programmer not a systems support... (4 Replies)
Discussion started by: jackdaw_at_work
4 Replies
Login or Register to Ask a Question