Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Redirect output of echo to a file Post 302842705 by alister on Friday 9th of August 2013 05:21:51 PM
Old 08-09-2013
This differs from the function in your original post in a critical way. The echo argument is unquoted.

Aside from the pathname expansion, the leading whitespace before "Argument 1" should have been lost.

By the way, to preserve whitespace and formatting, use code tags for data as well as code.

Regards,
Alister

Last edited by alister; 08-09-2013 at 06:32 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

redirect output to file?

Hi: I am currently working on a program which requires direct its ouput to a file here is an example ./proram arg_1 arg_2 when program ends all output will be arg_2 file Is that possible I am not a bad programmer, However I am stuck there. Can anyone give a hint? Thanks SW (1 Reply)
Discussion started by: slackware
1 Replies

2. UNIX for Dummies Questions & Answers

Redirect output to a file

Ahhhrrrggg I'm having a brain fart... I want to take the output of a command and redirect it to a file... This works.... $ man cp | cat >> copy_help but this doesn't keytool -help |cat >> keytool_help It just produces... these lines... more keytool_help ] ... ... (11 Replies)
Discussion started by: jimmyc
11 Replies

3. UNIX for Dummies Questions & Answers

redirect output to a file name

Hi all!! is possible to assign the output of some command to filename, i.e. grep_output.txt Otherwise, I want to open a new file which name is inside another, how can I do it? Thanks a lot! (7 Replies)
Discussion started by: csecnarf
7 Replies

4. UNIX for Dummies Questions & Answers

redirect output into the middle of a file

If I want to cat one file and have the output inserted into a specific place on another file, how is this done? I know how to append >> and to overwrite > but say I have a file with: File1: abc def ghi jkl And a File with: File2: mno pqr stu vwx And I want to place the... (5 Replies)
Discussion started by: glev2005
5 Replies

5. Shell Programming and Scripting

How redirect standard output to a file

Hi guys, i have a script named purgeErrors.ksh, when i execute this script i need to redirect the output to a log file in the same directory, how can i do that ?? -- Aditya (5 Replies)
Discussion started by: chaditya
5 Replies

6. Shell Programming and Scripting

How to redirect output of ls to a file?

Hi All, I want to redirect only the file names to a new file from the ls -ltr directroy. how Can i do it. my ls -ltr output will be as below. -rwxr-xr-x 1 118 103 28295 Jul 26 2006 event.podl -rwxr-xr-x 1 118 103 28295 Jul 26 2006 xyz.podl I want my new file... (6 Replies)
Discussion started by: girish.raos
6 Replies

7. UNIX for Advanced & Expert Users

Redirect Topas output to a file

Hi, I want to know how to redirect the output of topas -P to a file in a readable format. I tried doing it by using topas -P > topas.txt but the output is not properly aligned and when I opened it using vi it ahd some characters. Please help me out in this. Thanks (1 Reply)
Discussion started by: Preetha
1 Replies

8. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

9. Shell Programming and Scripting

Redirect script output to a file and mail the output

Hi Guys, I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts. I used below but it is not working: OFILE=/home/home1/report1 echo "report1 details" > $OFILE =/home/home1/1.sh > $OFILE echo... (7 Replies)
Discussion started by: Vivekit82
7 Replies

10. Shell Programming and Scripting

Echo cannot redirect first or second output to logfile

I created a script to do some work. I want to use "echo" to redirect "date" to log file. echo works to screen. But cannot redirect first or second "echo" output to logfile. Please help. My code looks like: STARTTIME=`date +%m-%d-%Y` LOGFILE=/directory/logfile.log echo "Start time:" $STARTTIME... (8 Replies)
Discussion started by: duke0001
8 Replies
XML::Filter::DetectWS(3)				User Contributed Perl Documentation				  XML::Filter::DetectWS(3)

NAME
XML::Filter::DetectWS - A PerlSAX filter that detects ignorable whitespace SYNOPSIS
use XML::Filter::DetectWS; my $detect = new XML::Filter::DetectWS (Handler => $handler, SkipIgnorableWS => 1); DESCRIPTION
This a PerlSAX filter that detects which character data contains ignorable whitespace and optionally filters it. Note that this is just a first stab at the implementation and it may change completely in the near future. Please provide feedback whether you like it or not, so I know whether I should change it. The XML spec defines ignorable whitespace as the character data found in elements that were defined in an <!ELEMENT> declaration with a model of 'EMPTY' or 'Children' (Children is the rule that does not contain '#PCDATA'.) In addition, XML::Filter::DetectWS allows the user to define other whitespace to be ignorable. The ignorable whitespace is passed to the PerlSAX Handler with the ignorable_whitespace handler, provided that the Handler implements this method. (Otherwise it is passed to the characters handler.) If the SkipIgnorableWS is set, the ignorable whitespace is simply discarded. XML::Filter::DetectWS also takes xml:space attributes into account. See below for details. CDATA sections are passed in the standard PerlSAX way (i.e. with surrounding start_cdata and end_cdata events), unless the Handler does not implement these methods. In that case, the CDATA section is simply passed to the characters method. Constructor Options o SkipIgnorableWS (Default: 0) When set, detected ignorable whitespace is discarded. o Handler The PerlSAX handler (or filter) that will receive the PerlSAX events from this filter. Current Implementation When determining which whitespace is ignorable, it first looks at the xml:space attribute of the parent element node (and its ancestors.) If the attribute value is "preserve", then it is *NOT* ignorable. (If someone took the trouble of adding xml:space="preserve", then that is the final answer...) If xml:space="default", then we look at the <!ELEMENT> definition of the parent element. If the model is 'EMPTY' or follows the 'Children' rule (i.e. does not contain '#PCDATA') then we know that the whitespace is ignorable. Otherwise we need input from the user somehow. The idea is that the API of DetectWS will be extended, so that you can specify/override e.g. which elements should behave as if xml:space="preserve" were set, and/or which elements should behave as if the <!ELEMENT> model was defined a certain way, etc. Please send feedback! The current implementation also detects whitespace after an element-start tag, whitespace before an element-end tag. It also detects whitespace before an element-start and after an element-end tag and before or after comments, processing instruction, cdata sections etc., but this needs to be reimplemented. In either case, the detected whitespace is split off into its own PerlSAX characters event and an extra property 'Loc' is added. It can have 4 possible values: o 1 (WS_START) - whitespace immediately after element-start tag o 2 (WS_END) - whitespace just before element-end tag o 3 (WS_ONLY) - both WS_START and WS_END, i.e. it's the only text found between the start and end tag and it's all whitespace o 0 (WS_INTER) - none of the above, probably before an element-start tag, after an element-end tag, or before or after a comment, PI, cdata section etc. Note that WS_INTER may not be that useful, so this may change. xml:space attribute The XML spec states that: A special attribute named xml:space may be attached to an element to signal an intention that in that element, white space should be preserved by applications. In valid documents, this attribute, like any other, must be declared if it is used. When declared, it must be given as an enumerated type whose only possible values are "default" and "preserve". For example: <!ATTLIST poem xml:space (default|preserve) 'preserve'> The value "default" signals that applications' default white-space processing modes are acceptable for this element; the value "preserve" indicates the intent that applications preserve all the white space. This declared intent is considered to apply to all elements within the content of the element where it is specified, unless overriden with another instance of the xml:space attribute. The root element of any document is considered to have signaled no intentions as regards application space handling, unless it provides a value for this attribute or the attribute is declared with a default value. [... end of excerpt ...] CAVEATS
This code is highly experimental! It has not been tested well and the API may change. The code that detects of blocks of whitespace at potential indent positions may need some work. See AUTHOR
Send bug reports, hints, tips, suggestions to Enno Derksen at <enno@att.com>. perl v5.8.0 2000-02-17 XML::Filter::DetectWS(3)
All times are GMT -4. The time now is 04:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy