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
GIT-TAR-TREE(1) 						    Git Manual							   GIT-TAR-TREE(1)

NAME
git-tar-tree - Create a tar archive of the files in the named tree object SYNOPSIS
git tar-tree [--remote=<repo>] <tree-ish> [ <base> ] DESCRIPTION
THIS COMMAND IS DEPRECATED. Use git archive with --format=tar option instead (and move the <base> argument to --prefix=base/). Creates a tar archive containing the tree structure for the named tree. When <base> is specified it is added as a leading path to the files in the generated tar archive. git tar-tree behaves differently when given a tree ID versus when given a commit ID or tag ID. In the first case the current time is used as modification time of each file in the archive. In the latter case the commit time as recorded in the referenced commit object is used instead. Additionally the commit ID is stored in a global extended pax header. It can be extracted using git get-tar-commit-id. OPTIONS
<tree-ish> The tree or commit to produce tar archive for. If it is the object name of a commit object. <base> Leading path to the files in the resulting tar archive. --remote=<repo> Instead of making a tar archive from local repository, retrieve a tar archive from a remote repository. CONFIGURATION
tar.umask This variable can be used to restrict the permission bits of tar archive entries. The default is 0002, which turns off the world write bit. The special value "user" indicates that the archiving user's umask will be used instead. See umask(2) for details. EXAMPLES
git tar-tree HEAD junk | (cd /var/tmp/ && tar xf -) Create a tar archive that contains the contents of the latest commit on the current branch, and extracts it in /var/tmp/junk directory. git tar-tree v1.4.0 git-1.4.0 | gzip >git-1.4.0.tar.gz Create a tarball for v1.4.0 release. git tar-tree v1.4.0^{tree} git-1.4.0 | gzip >git-1.4.0.tar.gz Create a tarball for v1.4.0 release, but without a global extended pax header. git tar-tree --remote=example.com:git.git v1.4.0 >git-1.4.0.tar Get a tarball v1.4.0 from example.com. git tar-tree HEAD:Documentation/ git-docs > git-1.4.0-docs.tar Put everything in the current head's Documentation/ directory into git-1.4.0-docs.tar, with the prefix git-docs/. GIT
Part of the git(1) suite Git 1.8.5.3 01/14/2014 GIT-TAR-TREE(1)
All times are GMT -4. The time now is 10:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy