05-24-2010
Hey, methyl:
Whitespace in the values precludes simple sourcing (and if quotes are allowed to appear in values, properly escaping whitespace would be a pain).
Multiple assignment to the same name also stand in the way of simple sourcing. PORT, SOURCE_IP, and a couple of others occur more than once, and the original code accumulates the values, instead of overwritting.
Cheers,
Alister
Last edited by alister; 05-24-2010 at 04:10 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
flavor -- AIX 4.2.1
I am putting together some HTML pages, some of which contain forms. The problem pops up when I attempt to pass variables (from the forms) from one HTML page to a cgi-like page created using ksh.
I have used the $1 - $9 vars, but they do not work with the passing. With... (1 Reply)
Discussion started by: Xiix
1 Replies
2. Shell Programming and Scripting
All,
Any chance someone could help me with this.... The script is reading from a file and for every line of input to the loop I am trying to assign a new varible. When i run the script I get the below errors. I have come to a bit of a dead end so any pointers/help would be very much... (1 Reply)
Discussion started by: oconnon2
1 Replies
3. UNIX for Dummies Questions & Answers
Given the following loop:
foreach id (DB4 GH4 CD4)
and the previously defined variables:
DB4sf DB4sfk DB4pp
GH4sf GH4sfk GH4pp
CD4sf CD4sfk CD4pp
how do i echo all of these variables using a one line command in the for loop. If it was a script, and assuming the previously mentioned... (8 Replies)
Discussion started by: wxornot
8 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I want create env variable for "/ramakrsihna/scripts"
help me on this. (1 Reply)
Discussion started by: koti_rama
1 Replies
5. Shell Programming and Scripting
I need to split a long varible which is a whole line read from a file into fields and store them in an array, the fields are delimited by pipe and a field may contain white spaces.
I tried the following concept test and it has problem with field 5 which contain a space, appearently so because... (3 Replies)
Discussion started by: gratus
3 Replies
6. UNIX for Dummies Questions & Answers
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies
7. Shell Programming and Scripting
For example
test.sh:
test="teststring"
cmd=$1
$cmd
For some reason I'm NOT seeing "teststring" when I type: ./test.sh "echo $test"
Any ideas on how to get around this?
I've tried commands like:
./test.sh "echo $($test)"
./test.sh "echo '$test'"
And many variations to no... (6 Replies)
Discussion started by: secops
6 Replies
8. UNIX for Dummies Questions & Answers
Hello all, I have a Mac OS X (10.7), and I need to set environment variables and paths for some programs I will be running. I have followed instructions and searched the Web for where to do this, but I can't seem to find an answer. I have tried using the VIM editor to write them into my .login,... (2 Replies)
Discussion started by: Tyler_92
2 Replies
9. Shell Programming and Scripting
Hi,
I have a file containing list of strings like
i:
Pink
Yellow
Green
and I have file having list of file names in a directory
j :
a
b
c
d
Where j contains of a ,b,c,d are as follows
a:
Pink (3 Replies)
Discussion started by: madabhg
3 Replies
10. Shell Programming and Scripting
Hi,
I want to grep multiple patterns from multiple files and save to multiple outputs. As of now its outputting all to the same file when I use this command.
Input : 108 files to check for 390 patterns to check for. output I need to 108 files with the searched patterns.
Xargs -I {} grep... (3 Replies)
Discussion started by: Diya123
3 Replies
LEARN ABOUT DEBIAN
mdom::token::whitespace
MDOM::Token::Whitespace(3pm) User Contributed Perl Documentation MDOM::Token::Whitespace(3pm)
NAME
MDOM::Token::Whitespace - Tokens representing ordinary white space
INHERITANCE
MDOM::Token::Whitespace
isa MDOM::Token
isa MDOM::Element
DESCRIPTION
As a full "round-trip" parser, MDOM records every last byte in a file and ensure that it is included in the MDOM::Document object.
This even includes whitespace. In fact, Perl documents are seen as "floating in a sea of whitespace", and thus any document will contain
vast quantities of "MDOM::Token::Whitespace" objects.
For the most part, you shouldn't notice them. Or at least, you shouldn't have to notice them.
This means doing things like consistently using the "S for significant" series of MDOM::Node and MDOM::Element methods to do things.
If you want the nth child element, you should be using "schild" rather than "child", and likewise "snext_sibling", "sprevious_sibling", and
so on and so forth.
METHODS
Again, for the most part you should really not need to do anything very significant with whitespace.
But there are a couple of convenience methods provided, beyond those provided by the parent MDOM::Token and MDOM::Element classes.
null
Because MDOM sees documents as sitting on a sort of substrate made of whitespace, there are a couple of corner cases that get particularly
nasty if they don't find whitespace in certain places.
Imagine walking down the beach to go into the ocean, and then quite unexpectedly falling off the side of the planet. Well it's somewhat
equivalent to that, including the whole screaming death bit.
The "null" method is a convenience provided to get some internals out of some of these corner cases.
Specifically it create a whitespace token that represents nothing, or at least the null string ''. It's a handy way to have some
"whitespace" right where you need it, without having to have any actual characters.
tidy
"tidy" is a convenience method for removing unneeded whitespace.
Specifically, it removes any whitespace from the end of a line.
Note that this doesn't include POD, where you may well need to keep certain types of whitespace. The entire POD chunk lives in its own
MDOM::Token::Pod object.
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2001 - 2006 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.12.4 2011-08-28 MDOM::Token::Whitespace(3pm)