how to write to file using fprintf in find command...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to write to file using fprintf in find command...
# 1  
Old 10-26-2004
Bug how to write to file using fprintf in find command...

Smilie I once again am looking through the man pages and am still working on the find command to fully comprehend all its attributes.. i am a little stuck on a problem with how many options to -print there are and the only two I know how to use are printf and -print..
i can not make heads or tails of fprintf function from the man pages as far as how to use it to write to file.. It says that fprintf means file print format which is all good but how do you use it.. ??
any suggestions are welcome
thanx moxxx68Smilie Smilie Smilie
# 2  
Old 10-26-2004
It works like -printf, but you don't need the redirection, it outputs to a file. So, to output just the filenames with no paths to "outfile", do something like

Code:
find ./ -fprintf outfile "%f\n"

Then, all filenames will appear in "outfile" instead of STDOUT

Cheers
ZB
# 3  
Old 10-26-2004
MySQL

cheers
moxx68Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Write log file for SFTP command

Hi I am transferring files to SFTP Server using sftp command(below), and want to write log file of this activity. Can you please advise if i am doing wrong. sftp -v -oIdentityFile=/home/bbm_user/bbm/private_open_ssh.ppm umf-sftp@bbm-prod-send.com <<EOF put $local_path/*.gz $remote_path/... (3 Replies)
Discussion started by: cnrj
3 Replies

2. Shell Programming and Scripting

Find Data in test file and write each out to a line

I have a .csv file that has been create from a google form and I need to extract the data from it that has been entered by users. The CSV will have anywhere between 100 and 1000 lines which comprise entr data for a sports carnival A few typical line is shown here to show the problem I have ... (19 Replies)
Discussion started by: kcpoole
19 Replies

3. Shell Programming and Scripting

Fprintf issue

i had to send a mail an attachment which i got from find command. But i did not get mail but could see the following line in the logs "aliased to fprintf.c". Can someone help me to understand what does it mean?..As this issue is not occuring now, i could not replicate the problem now.Thanks. (1 Reply)
Discussion started by: jesu
1 Replies

4. 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

5. Shell Programming and Scripting

How to find empty files in a directory and write their file names in a text?

I need to find empty files in a directory and write them into a text file. Directory will contain old files as well, i need to get the empty files for the last one hour only. (1 Reply)
Discussion started by: vel4ever
1 Replies

6. Shell Programming and Scripting

Display and write in file in one echo command

Hi All, I want to display content on command promt and also write in file. For that iI ahve to write two sentence echo "XXXXXXX" echo "XXXXXXXX" >> 1.txt Is there any way to write in one echo statement (1 Reply)
Discussion started by: vivek1489
1 Replies

7. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies

8. Programming

fprintf

Could someone explain me the following fprintf format: fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); Why just not use: fprintf(stderr, "ry `%s --help' for more information.\n", program_name) I mean what is _() does? (1 Reply)
Discussion started by: mirusnet
1 Replies

9. Shell Programming and Scripting

Need to write a script in UNIX to find a file if another file exists

So I have a lot of Java applications on my servers all having their own folder from the applications subdirectory. Now, I need to do the following. Search all the applications subdirectories for message.jar. If the message.jar file exists, I need to search the application directory for... (1 Reply)
Discussion started by: mmdawg
1 Replies

10. UNIX for Dummies Questions & Answers

help me write a find command

At times I have thse Oracle logfiles that grow like crazy and fill up a specific file system. I wanted to write a find command that lists which are the biggest files from the search path..so /qbidora02/oracledba/find . -name ....... <downward to the lowest level> and list file names, sizes and... (2 Replies)
Discussion started by: jigarlakhani
2 Replies
Login or Register to Ask a Question