Sponsored Content
Top Forums Shell Programming and Scripting How to print in the new line? Post 302853141 by targetshell on Friday 13th of September 2013 09:44:24 AM
Old 09-13-2013
Quote:
Originally Posted by Jotne
Using awk
Code:
echo "4" | awk '{for (j=$0;j>=1;j--) {for (i=1;i<=j;i++) printf i; print ""}}'
1234
123
12
1


Shell should take input from the user instead of assuming it to be "4"

---------- Post updated at 08:44 AM ---------- Previous update was at 08:41 AM ----------

Quote:
Originally Posted by apmcd47
Code:
{
   read x
   y=$x
   i=1
   while [ $i -le $x ]
   do
      j=1
      while [ $j -le $y ]
      do
         echo -n $j
         j=`expr $j + 1`
      done
      echo
      i=`expr $i + 1`
      y=`expr $y - 1`
   done
}

I have replaced the prints with echos and indented for reading purposes. YOu had an if construct which I assume you put in for debugging purposes.

Andrew

I should have quoted that I am working in KORN shell. I don't know how much implications it has on the syntax, but here is the O/P of your amended script.

Code:
3
-n 1
-n 2
-n 3

-n 1
-n 2

-n 1


Plz advise !

Last edited by Scott; 09-13-2013 at 10:46 AM.. Reason: Code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare multiple fields in file1 to file2 and print line and next line

Hello, I have two files that I need to compare and print out the line from file2 that has the first 6 fields matching the first 6 fields in file1. Complicating this are the following restrictions 1. file1 is only a few thousand lines at most and file2 is greater than 2 million 2. I need to... (7 Replies)
Discussion started by: gillesc_mac
7 Replies

2. Shell Programming and Scripting

read file line by line print column wise

I have a .csv file which is seperated with (;) inputfile --------- ZZZZ;AAAA;BBB;CCCC;DDD;EEE; YYYY;BBBB;CCC;DDDD;EEE;FFF; ... ... reading file line by line till end of file. while reading each line output format should be . i need to print only specific columns let say 5th... (2 Replies)
Discussion started by: rocking77
2 Replies

3. Shell Programming and Scripting

Print pipe separated list as line by line in Korn Shell

Korn Shell in AIX 6.1 I want to print the below shown pipe (|) separated list line by line. line=es349889|nhb882309|ts00293|snh03524|bg578835|bg37900|rnh00297|py882201|sg175883 for i in line do echo "Hello $line " done I wanted to execute the above for loop. But i can't even set the... (3 Replies)
Discussion started by: polavan
3 Replies

4. Shell Programming and Scripting

Using regex's from file1, print line and line after matches in file2

Good day, I have a list of regular expressions in file1. For each match in file2, print the containing line and the line after. file1: file2: Output: I can match a regex and print the line and line after awk '{lines = $0} /Macrosiphum_rosae/ {print lines ; print lines } ' ... (1 Reply)
Discussion started by: pathunkathunk
1 Replies

5. Shell Programming and Scripting

String search and print next all lines in one line until blank line

Dear all I want to search special string in file and then print next all line in one line until blank lines come. Help me plz for same. My input file and desire op file is as under. i/p file: A1/EXT "BSCABD1_21233G1" 757 130823 1157 RADIO X-CEIVER ADMINISTRATION BTS EXTERNAL FAULT ... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies

6. Shell Programming and Scripting

Echo printing a line in 2 lines; expected to print in one line

Dear All, fileName: therm.txt nc3h7o2h 7/27/98 thermc 3h 8o 2 0g 300.000 5000.000 1390.000 41 1.47017550e+01 1.71731699e-02-5.91205329e-06 9.21842570e-10-5.36438880e-14 2 -2.99988556e+04-4.93387892e+01 2.34710908e+00 4.34517484e-02-2.65357553e-05 3 ... (7 Replies)
Discussion started by: linuxUser_
7 Replies

7. Shell Programming and Scripting

How to print previous line of multiple pattern matched line?

Hello, I have below format log file, Comparing csv_converted_files/2201/9747.1012H67126.5077292103609547345.csv and csv_converted_files/22019/97447.1012H67126.5077292103609547345.csv Comparing csv_converted_files/2559/9447.1012H67126.5077292103609547345.csv and... (6 Replies)
Discussion started by: arvindshukla81
6 Replies

8. UNIX for Beginners Questions & Answers

Output to file print as single line, not separate line

example of problem: when I echo "$e" >> /home/cogiz/file.txt result prints to file as:AA BB CC I need it to save to file as this:AA BB CC I know it's probably something really simple but any help would be greatly appreciated. Thank You. Cogiz (7 Replies)
Discussion started by: cogiz
7 Replies

9. Shell Programming and Scripting

Find line then evaluate text on next line, print when condition is met

Hello, I am looking for a specific situation in a text file. The conditions are, > <CompoundName> InChI=1S/C5H12NO2/c1-5(2)4-8-6(3)7/h5H,4H2,1-3H3/q+1 I am looking for cases where the line "> <CompoundName>" is followed by a line that contains the string "InChI=" without regard to... (5 Replies)
Discussion started by: LMHmedchem
5 Replies

10. UNIX for Beginners Questions & Answers

Reading a file line by line and print required lines based on pattern

Hi All, i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field. i am using centos 7 Operating system. want to read below file. # cat /tmp/d5 NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
CSS::DOM::PropertyParser(3pm)				User Contributed Perl Documentation			     CSS::DOM::PropertyParser(3pm)

NAME
CSS::DOM::PropertyParser - Parser for CSS property values VERSION
Version 0.14 SYNOPSIS
use CSS::DOM::PropertyParser; $spec = new CSS::DOM::PropertyParser; # empty # OR $spec = $CSS::DOM::PropertyParser::Default->clone; $spec->add_property( overflow => { format => 'visible|hidden|scroll|auto', default => 'visible', inherit => 0, } ); $hashref = $spec->get_property('overflow'); $hashref = $spec->delete_property('overflow'); @names = $spec->property_names; DESCRIPTION
Objects of this class provide lists of supported properties for CSS::DOM style sheets. They also describe the syntax and parsing of those properties' values. Some CSS properties simply have their own values (e.g., overflow); some are abbreviated forms of several other properties (e.g., font). These are referred to in this documentation as 'simple' and 'shorthand' properties. CONSTRUCTOR
"$spec = new CSS::DOM::PropertyParser" returns an object that does not recognise any properties, to which you can add your own properties. There are two parser objects that come with this module. These are $CSS::DOM::PropertyParser::CSS21, which contains all of CSS 2.1, and $CSS::DOM::PropertyParser::Default, which is currently identical to the former, but to which parts of CSS 3 which eventually be added. If one of the default specs will do, you don't need a constructor. Simply pass it to the CSS::DOM constructor. If you want to modify it, clone it first, using the "clone" method (as shown in the "SYNOPSIS"). It is often convenient to clone the $Default spec and delete those properties that are not supported. METHODS
clone Returns a deep clone of the object. (It's deep so that you can modify the hashes/arrays inside it without modifying the original.) add_property ( $name, \%spec ) Adds the specification for the named property. See "HOW INDIVIDUAL PROPERTIES ARE SPECIFIED", below. get_property ( $name ) Returns the hashref passed to the previous method. delete_property ( $name ) Deletes the property and returns the hash ref. property_names Returns a list of the names of supported properties. subproperty_names ( $name ) Returns a list of the names of $name's sub-properties if it is a shorthand property. match Currently for internal use only. See the source code for documentation. Use at your own risk. HOW INDIVIDUAL PROPERTIES ARE SPECIFIED
Before you read this the first time, look at the "Example" below, and then come back and use this for reference. The specification for an individual property is a hash ref. There are several keys that each hash ref can have: format This is set to a string that describes the format of the property. The syntax used is based on the CSS 2.1 spec, but is not exactly the same. Unlike regular expressions, these formats are applied to properties on a token-by-token basis, not one character at a time. (This means that "100|200" cannot be written as "[1|2]00", as that would mean "1 00 | 2 00".) Whitespace is ignored in the format and in the CSS property except as a token separator. There are several metachars (in order of precedence): [...] grouping (like (?:...) ) (...) capturing group (just like a regexp) ? optional * zero or more + one or more || alternates that can come in any order and are optional, but at least one must be specified (the order will be retained if possible) | alternates, exactly one of which is required In addition, the following datatypes can be specified in angle brackets: <angle> A number with a 'deg', 'rad' or 'grad' suffix <attr> attr(...) <colour> (You can omit the 'u' if you want to.) One of CSS's predefined colour or system colour names, or a # followed by 3 or 6 hex digits, or the 'rgb(...)' format (rgba is supported, too) <counter> counter(...) <frequency> A unit of Hz or kHz <identifier> An identifier token <integer> An integer (really?!) <length> Number followed by a length unit (em, ex, px, in, cm, mm, pt, pc) <number> A number token <percentage> Number followed by % <shape> rect(...) <string> A string token <str/words> A sequence of identifiers or a single string (e.g., a font name) <time> A unit of seconds or milliseconds <url> A URL token The format for a shorthand property can contain the name of a sub-property in single ASCII quotes. All other characters are understood verbatim. It is not necessary to include the word 'inherit' in the format, since every property supports that. "<counter>" makes use of the specification for the list-style-type property. So if you modify the latter, it will affect "<counter>" as well. default The default value. This only applies to simple properties. inherit Whether the property is inherited. special_values A hash ref of values that are replaced with other values (e.g., "caption => '13px sans-serif'". The keys are lowercase identifier names. This feature only applies to single identifiers. In fact, it exists solely for the font property's use. list Set to true if the property is a list of values. The capturing parentheses in the format determine the individual values of the list. This applies to simple properties only. properties For a shorthand property, list the sub-properties here. The keys are the property names. The values are array refs. The elements within the arrays are numbers indicating which captures in the format are to be used for the sub-property's value. They are tried one after the other. Whichever is the first that matches (null matches not counting) is used. Sub-properties that are referenced in the "format" need not be listed here. serialise For shorthand properties only. Set this to a subroutine that serialises the property. It is called with a hashref of sub-properties as its sole argument. The values of the hash are blank for properties that are set to their initial values. This sub is only called when all sub-properties are set. Example our $CSS21 = new CSS::DOM::PropertyParser; my %properties = ( azimuth => { format => '<angle> | [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-inside ] || behind | leftwards | rightwards', default => '0', inherit => 1, }, 'background-attachment' => { format => 'scroll | fixed', default => 'scroll', inherit => 0, }, 'background-color' => { format => '<colour>', default => 'transparent', inherit => 0, }, 'background-image' => { format => '<url> | none', default => 'none', inherit => 0, }, 'background-position' => { format => '[<percentage>|<length>|left|right] [<percentage>|<length>|top|center|bottom]? | [top|bottom] [left|center|right]? | center [<percentage>|<length>|left|right|top|bottom| center]?', default => '0% 0%', inherit => 0, }, 'background-repeat' => { format => 'repeat | repeat-x | repeat-y | no-repeat', default => 'repeat', inherit => 0, }, background => { format => "'background-color' || 'background-image' || 'background-repeat' || 'background-attachment' || 'background-position'", serialise => sub { my $p = shift; my $ret = ''; for(qw/ background-color background-image background-repeat background-attachment background-position /) { length $p->{$_} and $ret .= "$p->{$_} "; } chop $ret; length $ret ? $ret : 'none' }, }, 'border-collapse' => { format => 'collapse | separate', inherit => 1, default => 'separate', }, 'border-color' => { format => '(<colour>)[(<colour>)[(<colour>)(<colour>)?]?]?', properties => { 'border-top-color' => [1], 'border-right-color' => [2,1], 'border-bottom-color' => [3,1], 'border-left-color' => [4,2,1], }, serialise => sub { my $p = shift; my @vals = map $p->{"border-$_-color"}, qw/top right bottom left/; $vals[3] eq $vals[1] and pop @vals, $vals[2] eq $vals[0] and pop @vals, $vals[1] eq $vals[0] and pop @vals; return join " ", @vals; }, }, 'border-spacing' => { format => '<length> <length>?', default => '0', inherit => 1, }, 'border-style' => { format => "(none|hidden|dotted|dashed|solid|double|groove|ridge| inset|outset) [ (none|hidden|dotted|dashed|solid|double|groove| ridge|inset|outset) [ (none|hidden|dotted|dashed|solid|double|groove| ridge|inset|outset) (none|hidden|dotted|dashed|solid|double|groove| ridge|inset|outset)? ]? ]?", properties => { 'border-top-style' => [1], 'border-right-style' => [2,1], 'border-bottom-style' => [3,1], 'border-left-style' => [4,2,1], }, serialise => sub { my $p = shift; my @vals = map $p->{"border-$_-style"}, qw/top right bottom left/; $vals[3] eq $vals[1] and pop @vals, $vals[2] eq $vals[0] and pop @vals, $vals[1] eq $vals[0] and pop @vals; return join " ", map $_||'none', @vals; }, }, 'border-top' => { format => "'border-top-width' || 'border-top-style' || 'border-top-color'", serialise => sub { my $p = shift; my $ret = ''; for(qw/ width style color /) { length $p->{"border-top-$_"} and $ret .= $p->{"border-top-$_"}." "; } chop $ret; $ret }, }, 'border-right' => { format => "'border-right-width' || 'border-right-style' || 'border-right-color'", serialise => sub { my $p = shift; my $ret = ''; for(qw/ width style color /) { length $p->{"border-right-$_"} and $ret .= $p->{"border-right-$_"}." "; } chop $ret; $ret }, }, 'border-bottom' => { format => "'border-bottom-width' || 'border-bottom-style' || 'border-bottom-color'", serialise => sub { my $p = shift; my $ret = ''; for(qw/ width style color /) { length $p->{"border-bottom-$_"} and $ret .= $p->{"border-bottom-$_"}." "; } chop $ret; $ret }, }, 'border-left' => { format => "'border-left-width' || 'border-left-style' || 'border-left-color'", serialise => sub { my $p = shift; my $ret = ''; for(qw/ width style color /) { length $p->{"border-left-$_"} and $ret .= $p->{"border-left-$_"}." "; } chop $ret; $ret }, }, 'border-top-color' => { format => '<colour>', default => "", inherit => 0, }, 'border-right-color' => { format => '<colour>', default => "", inherit => 0, }, 'border-bottom-color' => { format => '<colour>', default => "", inherit => 0, }, 'border-left-color' => { format => '<colour>', default => "", inherit => 0, }, 'border-top-style' => { format => 'none|hidden|dotted|dashed|solid|double|groove|ridge| inset|outset', default => 'none', inherit => 0, }, 'border-right-style' => { format => 'none|hidden|dotted|dashed|solid|double|groove|ridge| inset|outset', default => 'none', inherit => 0, }, 'border-bottom-style' => { format => 'none|hidden|dotted|dashed|solid|double|groove|ridge| inset|outset', default => 'none', inherit => 0, }, 'border-left-style' => { format => 'none|hidden|dotted|dashed|solid|double|groove|ridge| inset|outset', default => 'none', inherit => 0, }, 'border-top-width' => { format => '<length>|thin|thick|medium', default => 'medium', inherit => 0, }, 'border-right-width' => { format => '<length>|thin|thick|medium', default => 'medium', inherit => 0, }, 'border-bottom-width' => { format => '<length>|thin|thick|medium', default => 'medium', inherit => 0, }, 'border-left-width' => { format => '<length>|thin|thick|medium', default => 'medium', inherit => 0, }, 'border-width' => { format => "(<length>|thin|thick|medium) [ (<length>|thin|thick|medium) [ (<length>|thin|thick|medium) (<length>|thin|thick|medium)? ]? ]?", properties => { 'border-top-width' => [1], 'border-right-width' => [2,1], 'border-bottom-width' => [3,1], 'border-left-width' => [4,2,1], }, serialise => sub { my $p = shift; my @vals = map $p->{"border-$_-width"}, qw/top right bottom left/; $vals[3] eq $vals[1] and pop @vals, $vals[2] eq $vals[0] and pop @vals, $vals[1] eq $vals[0] and pop @vals; return join " ", map length $_ ? $_ : 'medium', @vals; }, }, border => { format => "(<length>|thin|thick|medium) || (none|hidden|dotted|dashed|solid|double|groove|ridge| inset|outset) || (<colour>)", properties => { 'border-top-width' => [1], 'border-right-width' => [1], 'border-bottom-width' => [1], 'border-left-width' => [1], 'border-top-style' => [2], 'border-right-style' => [2], 'border-bottom-style' => [2], 'border-left-style' => [2], 'border-top-color' => [3], 'border-right-color' => [3], 'border-bottom-color' => [3], 'border-left-color' => [3], }, serialise => sub { my $p = shift; my $ret = ''; for(qw/ width style color /) { my $temp = $p->{"border-top-$_"}; for my $side(qw/ right bottom left /) { $temp eq $p->{"border-$side-$_"} or return ""; } length $temp and $ret .= "$temp "; } chop $ret; $ret }, }, bottom => { format => '<length>|<percentage>|auto', default => 'auto', inherit => 0, }, 'caption-side' => { format => 'top|bottom', default => 'top', inherit => 1, }, clear => { format => 'none|left|right|both', default => 'none', inherit => 0, }, clip => { format => '<shape>|auto', default => 'auto', inherit => 0, }, color => { format => '<colour>', default => 'rgba(0,0,0,1)', inherit => 1, }, content => { format => '( normal|none|open-quote|close-quote|no-open-quote| no-close-quote|<string>|<url>|<counter>|<attr> )+', default => 'normal', inherit => 0, list => 1, }, 'counter-increment' => { format => '[(<identifier>) (<integer>)? ]+ | none', default => 'none', inherit => 0, list => 1, }, 'counter-reset' => { format => '[(<identifier>) (<integer>)? ]+ | none', default => 'none', inherit => 0, list => 1, }, 'cue-after' => { format => '<url>|none', default => 'none', inherit => 0, }, 'cue-before' => { format => '<url>|none', default => 'none', inherit => 0, }, cue =>{ format => '(<url>|none) (<url>|none)?', properties => { 'cue-before' => [1], 'cue-after' => [2,1], }, serialise => sub { my $p = shift; my @vals = @$p{"cue-before", "cue-after"}; $vals[1] eq $vals[0] and pop @vals; return join " ", map length $_ ? $_ : 'none', @vals; }, }, cursor => { format => '[(<url>) ,]* (auto|crosshair|default|pointer|move|e-resize| ne-resize|nw-resize|n-resize|se-resize|sw-resize| s-resize|w-resize|text|wait|help|progress)', default => 'auto', inherit => 1, list => 1, }, direction => { format => 'ltr|rtl', default => 'ltr', inherit => 1, }, display => { format => 'inline|block|list-item|run-in|inline-block|table| inline-table|table-row-group|table-header-group| table-footer-group|table-row|table-column-group| table-column|table-cell|table-caption|none', default => 'inline', inherit => 0, }, elevation => { format => '<angle>|below|level|above|higher|lower', default => '0', inherit => 1, }, 'empty-cells' => { format => 'show|hide', default => 'show', inherit => 1, }, float => { format => 'left|right|none', default => 'none', inherit => 0, }, 'font-family' => { # aka typeface format => '(serif|sans-serif|cursive|fantasy|monospace| <str/words>) [,(serif|sans-serif|cursive|fantasy|monospace| <str/words>)]*', default => 'Times, serif', inherit => 1, list => 1, }, 'font-size' => { format => 'xx-small|x-small|small|medium|large|x-large|xx-large| larger|smaller|<length>|<percentage>', default => 'medium', inherit => 1, }, 'font-style' => { format => 'normal|italic|oblique', default => 'normal', inherit => 1, }, 'font-variant' => { format => 'normal | small-caps', default => 'normal', inherit => 1, }, 'font-weight' => { format => 'normal|bold|bolder|lighter| 100|200|300|400|500|600|700|800|900', default => 'normal', inherit => 1, }, font => { format => "[ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]? 'font-family'", special_values => { caption => '13px Lucida Grande, sans-serif', icon => '13px Lucida Grande, sans-serif', menu => '13px Lucida Grande, sans-serif', 'message-box' => '13px Lucida Grande, sans-serif', 'small-caption' => '11px Lucida Grande, sans-serif', 'status-bar' => '10px Lucida Grande, sans-serif', }, serialise => sub { my $p = shift; my $ret = ''; for(qw/ style variant weight /) { length $p->{"font-$_"} and $ret .= $p->{"font-$_"}." "; } $ret .= length $p->{'font-size'} ? $p->{'font-size'} : 'medium'; $ret .= "/$p->{'line-height'}" if length $p->{'line-height'}; $ret .= " " . ($p->{'font-family'} || "Times, serif"); $ret }, }, height => { format => '<length>|<percentage>|auto', default => 'auto', inherit => 0, }, left => { format => '<length>|<percentage>|auto', default => 'auto', inherit => 0, }, 'letter-spacing' => { # aka tracking format => 'normal|<length>', default => 'normal', inherit => 1, }, 'line-height' => { # aka leading format => 'normal|<number>|<length>|<percentage>', default => "normal", inherit => 1, }, 'list-style-image' => { format => '<url>|none', default => 'none', inherit => 1, }, 'list-style-position' => { format => 'inside|outside', default => 'outside', inherit => 1, }, 'list-style-type' => { format => 'disc|circle|square|decimal|decimal-leading-zero| lower-roman|upper-roman|lower-greek|lower-latin| upper-latin|armenian|georgian|lower-alpha| upper-alpha', default => 'disc', inherit => 1, }, 'list-style' => { format => "'list-style-type'||'list-style-position'|| 'list-style-image'", serialise => sub { my $p = shift; my $ret = ''; for(qw/ type position image /) { $p->{"list-style-$_"} and $ret .= $p->{"list-style-$_"}." "; } chop $ret; $ret || 'disc' }, }, 'margin-right' => { format => '<length>|<percentage>|auto', default => '0', inherit => 0, }, 'margin-left' => { format => '<length>|<percentage>|auto', default => '0', inherit => 0, }, 'margin-top' => { format => '<length>|<percentage>|auto', default => '0', inherit => 0, }, 'margin-bottom' => { format => '<length>|<percentage>|auto', default => '0', inherit => 0, }, margin => { format => "(<length>|<percentage>|auto) [ (<length>|<percentage>|auto) [ (<length>|<percentage>|auto) (<length>|<percentage>|auto)? ]? ]?", properties => { 'margin-top' => [1], 'margin-right' => [2,1], 'margin-bottom' => [3,1], 'margin-left' => [4,2,1], }, serialise => sub { my $p = shift; my @vals = map $p->{"margin-$_"}, qw/top right bottom left/; $vals[3] eq $vals[1] and pop @vals, $vals[2] eq $vals[0] and pop @vals, $vals[1] eq $vals[0] and pop @vals; return join " ", map $_ || 0, @vals; }, }, 'max-height' => { format => '<length>|<percentage>|none', default => 'none', inherit => 0, }, 'max-width' => { format => '<length>|<percentage>|none', default => 'none', inherit => 0, }, 'min-height' => { format => '<length>|<percentage>|none', default => 'none', inherit => 0, }, 'min-width' => { format => '<length>|<percentage>|none', default => 'none', inherit => 0, }, orphans => { format => '<integer>', default => 2, inherit => 1, }, 'outline-color' => { format => '<colour>|invert', default => 'invert', inherit => 0, }, 'outline-style' => { format => 'none|hidden|dotted|dashed|solid|double|groove|ridge| inset|outset', default => 'none', inherit => 0, }, 'outline-width' => { format => '<length>|thin|thick|medium', default => 'medium', inherit => 0, }, outline => { format => "'outline-color'||'outline-style'||'outline-width'", serialise => sub { my $p = shift; my $ret = ''; for(qw/ color style width /) { length $p->{"outline-$_"} and $ret .= $p->{"outline-$_"}." "; } chop $ret; length $ret ? $ret : 'invert'; }, }, overflow => { format => 'visible|hidden|scroll|auto', default => 'visible', inherit => 0, }, 'padding-top' => { format => '<length>|<percentage>', default => 0, inherit => 0, }, 'padding-right' => { format => '<length>|<percentage>', default => 0, inherit => 0, }, 'padding-bottom' => { format => '<length>|<percentage>', default => 0, inherit => 0, }, 'padding-left' => { format => '<length>|<percentage>', default => 0, inherit => 0, }, padding => { format => "(<length>|<percentage>) [ (<length>|<percentage>) [ (<length>|<percentage>) (<length>|<percentage>)? ]? ]?", properties => { 'padding-top' => [1], 'padding-right' => [2,1], 'padding-bottom' => [3,1], 'padding-left' => [4,2,1], }, serialise => sub { my $p = shift; my @vals = map $p->{"padding-$_"}, qw/top right bottom left/; $vals[3] eq $vals[1] and pop @vals, $vals[2] eq $vals[0] and pop @vals, $vals[1] eq $vals[0] and pop @vals; return join " ", map $_ || 0, @vals; }, }, 'page-break-after' => { format => 'auto|always|avoid|left|right', default => 'auto', inherit => 0, }, 'page-break-before' => { format => 'auto|always|avoid|left|right', default => 'auto', inherit => 0, }, 'page-break-inside' => { format => 'avoid|auto', default => 'auto', inherit => 1, }, 'pause-after' => { format => '<time>|<percentage>', default => 0, inherit => 0, }, 'pause-before' => { format => '<time>|<percentage>', default => 0, inherit => 0, }, pause => { format => '(<time>|<percentage>)(<time>|<percentage>)?', properties => { 'pause-before' => [1], 'pause-after' => [2,1], } }, 'pitch-range' => { format => '<number>', default => 50, inherit => 1, }, pitch => { format => '<frequency>|x-low|low|medium|high|x-high', default => 'medium', inherit => 1, }, 'play-during' => { format => '<url> [ mix || repeat ]? | auto | none', default => 'auto', inherit => 0, }, position => { format => 'static|relative|absolute|fixed', default => 'relative', inherit => 0, }, quotes => { format => '[(<string>)(<string>)]+|none', default => 'none', inherit => 1, list => 1, }, richness => { format => '<number>', default => 50, inherit => 1, }, right => { format => '<length>|<percentage>|auto', default => 'auto', inherit => 0, }, 'speak-header' => { format => 'once|always', default => 'once', inherit => 1, }, 'speak-numeral' => { format => 'digits|continuous', default => 'continuous', inherit => 1, }, 'speak-punctuation' => { format => 'code|none', default => 'none', inherit => 1, }, speak => { format => 'normal|none|spell-out', default => 'normal', inherit => 1, }, 'speech-rate' => { format => '<number>|x-slow|slow|medium|fast|x-fast|faster|slower', default => 'medium', inherit => 1, }, stress => { format => '<number>', default => 50, inherit => 1, }, 'table-layout' => { format => 'auto|fixed', default => 'auto', inherit => 0, }, 'text-align' => { format => 'left|right|center|justify|auto', default => 'auto', inherit => 1, }, 'text-decoration' => { format => 'none | underline||overline||line-through||blink ', default => 'none', inherit => 0, }, 'text-indent' => { format => '<length>|<percentage>', default => 0, inherit => 1, }, 'text-transform' => { format => 'capitalize|uppercase|lowercase|none', default => 'none', inherit => 1, }, top => { format => '<length>|<percentage>|auto', default => 'auto', inherit => 0, }, 'unicode-bidi' => { format => 'normal|embed|bidi-override', default => 'normal', inherit => 0, }, 'vertical-align' => { format => 'baseline|sub|super|top|text-top|middle|bottom| text-bottom|<percentage>|<length>', default => 'baseline', inherit => 0, }, visibility => { format => 'visible|hidden|collapse', default => 'visible', inherit => 1, }, 'voice-family' => { format => '(male|female|child|<str/words>) [, (male|female|child|<str/words>) ]*', default => '', inherit => 1, list => 1, }, volume => { format => '<number>|<percentage>|silent|x-soft|soft|medium|loud| x-loud', default => 'medium', inherit => 1, }, 'white-space' => { format => 'normal|pre|nowrap|pre-wrap|pre-line', default => 'normal', inherit => 1, }, widows => { format => '<integer>', default => 2, inherit => 1, }, width => { format => '<length>|<percentage>|auto', default => 'auto', inherit => 0, }, 'word-spacing' => { format => 'normal|<length>', default => 'normal', inherit => 1, }, 'z-index' => { format => 'auto|<integer>', default => 'auto', inherit => 0, }, ); $CSS21->add_property( $_ => $properties{$_} ) for keys %properties; SEE ALSO
CSS::DOM perl v5.10.1 2010-12-10 CSS::DOM::PropertyParser(3pm)
All times are GMT -4. The time now is 06:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy