Sponsored Content
Top Forums Shell Programming and Scripting Script with variable and condition Post 302749117 by RudiC on Thursday 27th of December 2012 01:56:49 PM
Old 12-27-2012
Pls use code tags as advised.
All proposals above are fine and work, but I think your ./t2[5]: SIZ: not found error comes from the two spaces around the equals-sign when defining SIZ. Remove them, test, and come back with result.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

if condition for variable existing in file

Hi, Sorry for the dumb question but I can't seem to figure this one out. I want to write an if condition that basically checks if my variable is in a file. So far I have the following: if ] then do something else do something else fi So essentially if the grep returns something then... (3 Replies)
Discussion started by: eltinator
3 Replies

2. Shell Programming and Scripting

Bash: if condition as variable

How can I use a variable that has the conditions for the if statement stored in it? my test script condition=" || || " if "$condition" then echo "true" else echo "false" fi output $ ./test2.sh ./test2.sh: line 3: || || : command not found false (2 Replies)
Discussion started by: curlee2002
2 Replies

3. Shell Programming and Scripting

Problem using shell variable in awk if condition

Hi friends, I'm having a bit of a problem using shell variable in an awk if statement. Please note that i'm using -v option as listed in many forums but I still don't get it working. Here's my code. Kindly help as I've gone crazy trying to work this out :wall: #!/bin/bash -xv ... (4 Replies)
Discussion started by: vishwas.s
4 Replies

4. Shell Programming and Scripting

Compare the two variable with if condition

Please help me with this: I need to compare two values in if condition in shell script but its goes always to else condition: TIME_CHECK=PM TIME-CLOCK=PM if ; then echo "You have access!" else echo "ACCESS DENIED!" fi (5 Replies)
Discussion started by: aroragaurav.84
5 Replies

5. Shell Programming and Scripting

Echo not displaying variable in If-Else condition

if then echo "Entry Valid : ${x_oug}" else echo "Entry Invalid : " 0 fi In the above code the 3rd line is not working... it does not print anything I tried following as well .. but no luck! echo "Entry Valid : ... (13 Replies)
Discussion started by: Chetanz
13 Replies

6. UNIX for Dummies Questions & Answers

Variable in IF condition

In AIX, why is it variable VAR becomes true in the condition despite VAR was unassigned and not equal to 1? In Linux, it was traced as an error as VAR is not declared as variable and expecting an integer as argument. one.sh VAR=1 if ; then echo "One" fi if ; then echo "Two"... (5 Replies)
Discussion started by: budz26
5 Replies

7. Shell Programming and Scripting

Checking for null condition in a UNIX variable

i have this code for i in `cat sql_output.txt` do -- some script commands done sql_output.txt has 1 column with employee_ids If the sql_output.txt is null then the do loop should not execute. How can i implement this. for i in `cat sql_output.txt` If i is null or empty then ... (5 Replies)
Discussion started by: rafa_fed2
5 Replies

8. Shell Programming and Scripting

If condition to check null variable

Guys, Please help me on the below sample.cfg var=NULL sample.sh #!/bin/sh . /sample.cfg if ;then 1 st command here else 2 nd command here fi (3 Replies)
Discussion started by: AraR87
3 Replies

9. Shell Programming and Scripting

Shell variable as awk condition

Hi, I'm trying to automate part of a script which uses awk to grab out some lines of a log file based on certain fields matching. For example, my log file looks something like the following (but 1000s of lines): 1 Tom 123 abc 345 2 Dick 345 abc 678 3 Harry 567 abc 345 4 Tom 345 cde 345... (3 Replies)
Discussion started by: chrissycc
3 Replies

10. Shell Programming and Scripting

How to add second variable in awk nested if condition?

Hi Gurus, I have a command to assign value based on input value. current condition is "if pattern matches "case", then assign "HOLD" else "SUCC"right now, I need to add one more condition (variable name is VAR). the condition is "if pattern1 matches "case", then assign "HOLD" else if... (2 Replies)
Discussion started by: ken6503
2 Replies
HTML::Clean(3)						User Contributed Perl Documentation					    HTML::Clean(3)

NAME
HTML::Clean - Cleans up HTML code for web browsers, not humans SYNOPSIS
use HTML::Clean; $h = new HTML::Clean($filename); # or.. $h = new HTML::Clean($htmlcode); $h->compat(); $h->strip(); $data = $h->data(); print $$data; DESCRIPTION
The HTML::Clean module encapsulates a number of common techniques for minimizing the size of HTML files. You can typically save between 10% and 50% of the size of a HTML file using these methods. It provides the following features: Remove unneeded whitespace (begining of line, etc) Remove unneeded META elements. Remove HTML comments (except for styles, javascript and SSI) Replace tags with equivilant shorter tags (<strong> --> <b>) etc. The entire proces is configurable, so you can pick and choose what you want to clean. THE HTML
::Clean CLASS $h = new HTML::Clean($dataorfile, [$level]); This creates a new HTML::Clean object. A Prerequisite for all other functions in this module. The $dataorfile parameter supplies the input HTML, either a filename, or a reference to a scalar value holding the HTML, for example: $h = new HTML::Clean("/htdocs/index.html"); $html = "<strong>Hello!</strong>"; $h = new HTML::Clean($html); An optional 'level' parameter controls the level of optimization performed. Levels range from 1 to 9. Level 1 includes only simple fast optimizations. Level 9 includes all optimizations. $h->initialize($dataorfile) This function allows you to reinitialize the HTML data used by the current object. This is useful if you are processing many files. $dataorfile has the same usage as the new method. Return 0 for an error, 1 for success. $h->level([$level]) Get/set the optimization level. $level is a number from 1 to 9. $myref = $h->data() Returns the current HTML data as a scalar reference. strip(\%options); Removes excess space from HTML You can control the optimizations used by specifying them in the %options hash reference. The following options are recognized: boolean values (0 or 1 values) whitespace Remove excess whitespace shortertags <strong> -> <b>, etc.. blink No blink tags. contenttype Remove default contenttype. comments Remove excess comments. entities &quot; -> ", etc. dequote remove quotes from tag parameters where possible. defcolor recode colors in shorter form. (#ffffff -> white, etc.) javascript remove excess spaces and newlines in javascript code. htmldefaults remove default values for some html tags lowercasetags translate all HTML tags to lowercase parameterized values meta Takes a space separated list of meta tags to remove, default "GENERATOR FORMATTER" emptytags Takes a space separated list of tags to remove when there is no content between the start and end tag, like this: <b></b>. The default is 'b i font center' compat() This function improves the cross-platform compatibility of your HTML. Currently checks for the following problems: Insuring all IMG tags have ALT elements. Use of Arial, Futura, or Verdana as a font face. Positioning the <TITLE> tag immediately after the <head> tag. defrontpage(); This function converts pages created with Microsoft Frontpage to something a Unix server will understand a bit better. This function currently does the following: Converts Frontpage 'hit counters' into a unix specific format. Removes some frontpage specific html comments SEE ALSO
Modules FrontPage::Web, FrontPage::File Web Sites Distribution Site - http://people.itu.int/~lindner/ AUTHORS
Paul Lindner for the International Telecommunication Union (ITU) COPYRIGHT
The HTML::Strip module is Copyright (c) 1998,99 by the ITU, Geneva Switzerland. All rights reserved. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 66: You forgot a '=back' before '=head2' Around line 658: =back without =over perl v5.12.1 2010-07-05 HTML::Clean(3)
All times are GMT -4. The time now is 01:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy