Sponsored Content
Full Discussion: Redirecting 'find' output...
Top Forums UNIX for Dummies Questions & Answers Redirecting 'find' output... Post 302248003 by dan-e on Thursday 16th of October 2008 10:38:37 PM
Old 10-16-2008
OK! Good advice guys... but the mystery is still unsolved.

Adding -print to the end of the command did fix the issue with all file names being output (cheers zaxxon), like so:
Code:
find / -type f -name "*.ksh" -print

... now I get only the files I care about, but it still won't append the output to file! It will redirect to the file, but not append.

Any clues to that end? Is it possible to disable append-redirection?

Here's a handy take-home pack of the BS I am experiencing:
Code:
qmmm1#cat testfind.sh                                               | < My little script
find / -type f -name "*.tar" -print>tars.txt                        | < Find em once and dump to file
pwd >> tars.txt                                                     | < ...just to make a mark in output file
find / -type f -name "*.tar" -print>>tars.txt                       | < Find em again and append to file
                                                                    |
qmmm1#cat tars.txt                                                  |
/var/opt/OV/share/snmp_mibs/Vendor/cps.tar                          | < Here they are...
/var/opt/OV/share/snmp_mibs/fsms.tar                                |
/var/opt/OV/conf/OpC/qmmm1.tar                                      |
/var/agent/OPC/root/opt/OV/lib/perl/perl.tar                        |
/opt/OV/contrib/NNM/Cisco/CW2K/hpovwebintegrate1.2.0-sol-rme2.0.tar |
/opt/OV/lib/perl/perl.tar                                           |
/opt/OV/newconfig/OVWIN-BGROUND/backgrounds.tar                     |
/opt/hpxt/enware2/enware2.tar                                       |
/users/dgarnsly/PSOV_03238.tar                                      |
/users/f845073/qqc1_mysql.tar                                       |
/users/f845073/qcct2_templates_20060228.tar                         |
/users/c745073/qcct2_templates_20060301.tar                         |
/users/mnams/qmmm1.tar                                              |
/users/c675133/fixed.tar                                            |
/.cpan/build/Archive-Tar-1.04/t/src/long/bar.tar                    |
/.cpan/build/Archive-Tar-1.04/t/src/short/bar.tar                   |
/users/d269836                                                      |< Here's my bookmark
qmmm1#                                                              |< ...um where's the rest?


Last edited by dan-e; 10-17-2008 at 12:35 AM.. Reason: Code sample added
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Redirecting the startup output

Is there any way to redirect the output of the startup of a sun E250. Im basically trying to troubleshoot some init scripts and it would be useful to have a log of the startup output. (3 Replies)
Discussion started by: blakmk
3 Replies

2. UNIX for Advanced & Expert Users

redirecting the output of aspell

Hi, I have 2 identical servers both running aspell but for some reason I can't redirect the output to a file on one of them. This is what I'm trying to do: echo feck | aspell -l > errors.txt On one machine this works fine but the other it doesn't (the file is created but it is empty). ... (6 Replies)
Discussion started by: leekb
6 Replies

3. Shell Programming and Scripting

Redirecting OUTPUT

Hi, I want to move the output of a command/script to a file as well as to to be displayed on stdout. Can anybody help me in this. Thanks in advace .. -Chanakya M (1 Reply)
Discussion started by: Chanakya.m
1 Replies

4. Shell Programming and Scripting

help redirecting output from mailbot

Hello...I'm having problems redirecting output from a script from a mailbot. It is a perl script that has the email sent to op_shipper piped into it. I am receiving the email with sendmail and here is what my alias looks like for the script am I having problems with in /etc/aliases: ... (3 Replies)
Discussion started by: kuliksco
3 Replies

5. Shell Programming and Scripting

Redirecting output to file

Hi, Below is the whole string which is to be redirected to the new file. su - oracle -c "exp $user/$pass file=/oracle/oradata/backup/exp_trn_tables_`date +%d_%b_20%y_%H_%M_%S`.dmp log=/oracle/oradata/backup/exp_trn_tables_`date +%d_%b_20%y_%H_%M_%S`.log tables=table1,table2 statistics=none" ... (3 Replies)
Discussion started by: milink
3 Replies

6. UNIX for Dummies Questions & Answers

redirecting script output

Hello, I am interested in taking the output from a script i wrote and using it as input to a different script i wrote. So for example i want to take the output from program2 and use it as a parameter for program1. I didnt think i could use the >> symbols because i think that is just for .txt... (4 Replies)
Discussion started by: GmGeubt
4 Replies

7. Shell Programming and Scripting

find: missing argument to `-exec' while redirecting using find in perl

Hi Friends, Please help me to sort out this problem, I am running this in centos o/s and whenever I run this script I am getting "find: missing argument to `-exec' " but when I run the same code in the command line I didn't find any problem. I am using perl script to run this ... (2 Replies)
Discussion started by: ramkumarselvam
2 Replies

8. Shell Programming and Scripting

redirecting output using if-then-else in awk

I am trying to filter records based on number of "|", delimiter in my application. If number of "|" is greater than 14 its a bad record, else its a good record. I have to redirect output to two different files based on the if-then-else evaluation in AWK. if number of “|” in file_0 > 14 ... (2 Replies)
Discussion started by: siteregsam
2 Replies

9. Shell Programming and Scripting

Redirecting the output

For example, if we run the below command, symcfg list -thin -pool , results in an output most of the times and if the out is generated i'm able to redirect the output to a file. but sometimes it doesnt result any output and even though the output is being redirected, i can see "No Thin Pools "... (2 Replies)
Discussion started by: web2moha
2 Replies

10. Shell Programming and Scripting

Redirecting output using if with awk

I have this line were I am selecting some fields from one file and creating a new file for the selected data. awk -F "\"*,\"*" '{print $1"," $2}' folderone/list.txt > folderone/qlist.txt This works, but then from this new file I want it to create a new file where it separates data: $2 >5 it... (2 Replies)
Discussion started by: rluna
2 Replies
unix2dos(1)						      General Commands Manual						       unix2dos(1)

NAME
unix2dos - UNIX to DOS text file format converter SYNOPSYS
unix2dos [options] [-c convmode] [-o file ...] [-n infile outfile ...] Options: [-hkqV] [--help] [--keepdate] [--quiet] [--version] DESCRIPTION
This manual page documents unix2dos, the program that converts text files in UNIX format to DOS format. OPTIONS
The following options are available: -h --help Print online help. -k --keepdate Keep the date stamp of output file same as input file. -q --quiet Quiet mode. Suppress all warning and messages. -V --version Prints version information. -c --convmode convmode Sets conversion mode. Simulates unix2dos under SunOS. -o --oldfile file ... Old file mode. Convert the file and write output to it. The program default to run in this mode. Wildcard names may be used. -n --newfile infile outfile ... New file mode. Convert the infile and write output to outfile. File names must be given in pairs and wildcard names should NOT be used or you WILL lost your files. EXAMPLES
Get input from stdin and write output to stdout. unix2dos Convert and replace a.txt. Convert and replace b.txt. unix2dos a.txt b.txt unix2dos -o a.txt b.txt Convert and replace a.txt in ASCII conversion mode. Convert and replace b.txt in ISO conversion mode. unix2dos a.txt -c iso b.txt unix2dos -c ascii a.txt -c iso b.txt Convert and replace a.txt while keeping original date stamp. unix2dos -k a.txt unix2dos -k -o a.txt Convert a.txt and write to e.txt. unix2dos -n a.txt e.txt Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt. unix2dos -k -n a.txt e.txt Convert and replace a.txt. Convert b.txt and write to e.txt. unix2dos a.txt -n b.txt e.txt unix2dos -o a.txt -n b.txt e.txt Convert c.txt and write to e.txt. Convert and replace a.txt. Convert and replace b.txt. Convert d.txt and write to f.txt. unix2dos -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt DIAGNOSTICS
BUGS
The program does not work properly under MSDOS in stdio processing mode. If you know why is that so, please tell me. AUTHOR
Benjamin Lin - ( blin@socs.uts.edu.au ) MISCELLANY
Tested environment: Linux 1.2.0 with GNU C 2.5.8 SunOS 4.1.3 with GNU C 2.6.3 MS-DOS 6.20 with Borland C++ 4.02 Suggestions and bug reports are welcome. SEE ALSO
dos2unix(1) 1995.03.31 unix2dos v2.2 unix2dos(1)
All times are GMT -4. The time now is 02:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy