Sponsored Content
Top Forums Shell Programming and Scripting Shell assign variable to another variable Post 302472327 by 3junior on Tuesday 16th of November 2010 10:23:42 PM
Old 11-16-2010
Shell assign variable to another variable

How can I assign a variable to an variable. IE $car=honda

One way I can do it is export $car=honda
or
let $car=2323

Is there any other ways to preform this task
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to assign sql output data to shell script variable

Hi Guys ! I am new to unix and want to find out how we can make sql statement data to shell script variable? Any help/suggestion is greatly appreciated -Chandra (1 Reply)
Discussion started by: kattics
1 Replies

2. Shell Programming and Scripting

How to assign the result of a SQL command to more than one variable in shell script.

Hi Friends... Please assist me to assign the result of a SQL query that results two column, to two variables. Pls find the below code that I write for assigning one column to one variable. and please correct if anything wrong.. #! /bin/sh no=' sqlplus -s uname/password@DBname... (4 Replies)
Discussion started by: little_wonder
4 Replies

3. Shell Programming and Scripting

assign awk's variable to shell script's variable?

Dear All, we have a command output which looks like : Total 200 queues in 30000 Kbytes and we're going to get "200" and "30000" for further process. currently, i'm using : numA=echo $OUTPUT | awk '{print $2}' numB=echo $OUTPUT | awk '{print $5}' my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies

4. Shell Programming and Scripting

How to assign record count output of isql to a shell variable ?

isql select count(*) from Table eof How to assign record count output of isql query to a shell variable ? (4 Replies)
Discussion started by: vikram3.r
4 Replies

5. Shell Programming and Scripting

Assign perl output to ksh shell variable

Hello, I am writing a ksh script on an AIX system. I need to get the date and time from a file into a variable. I found the following perl script from another post on this site and modified it slightly to output the format I need: perl -e '@d=localtime ((stat(shift)));... (4 Replies)
Discussion started by: swimp
4 Replies

6. UNIX for Dummies Questions & Answers

Assign SQL result in shell variable

Hi im trying to assign the result of the db2 command to a variable inside a shell script... : tab_cnt=`db2 "select count(*) from syscat.tables where tabname = 'ABC' and tabschema = 'MATT01'" |head -4|tail +4|cut -c 11` : echo $tab_cnt when i echo im getting a blank value.. im expecting... (1 Reply)
Discussion started by: matt01
1 Replies

7. Shell Programming and Scripting

How to assign a shell variable to a NUMBER parameter in pl/sql?

I have the below script running for generating file from PL/SQL stored procedure. I need to declare a shell variable and then pass this to sqlplus command to pass the same as a INPUT parameter for the stored procedure. Please help to do this. #!/bin/sh minlimit=0 maxlimit=10 size=100 while... (0 Replies)
Discussion started by: vel4ever
0 Replies

8. Shell Programming and Scripting

how to assign more than 1 variable value from 1 common shell to many other shell files

i have 1 file say LogDirectory='/var/tmp/logs' DataDirectory='/var/tmp/data' DBUSER='scott' now i want to access these variables in many files where #!/bin/bash ${DBUSER} , ${DataDirectory} are called how do i do that? Video tutorial on how to use code tags in The UNIX and Linux... (2 Replies)
Discussion started by: Gl@)!aTor
2 Replies

9. UNIX for Beginners Questions & Answers

How can I assign awk's variable to shell script's variable?

I have the following script, and I want to assign the output ($10 and $5) from awk to N and L: grdinfo data.grd | awk '{print $10,$5}'| read N L output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies

10. Shell Programming and Scripting

How to assign awk values to shell variable?

Hi Gurus, I have a script which assign awk output to shell variable. current it uses two awk command to assign value to two variables. I want to use one command to assign two values to two variables. I tried the code, but it does't work. kindly provide your suggestion. current code... (2 Replies)
Discussion started by: green_k
2 Replies
Highlight(3pm)						User Contributed Perl Documentation					    Highlight(3pm)

NAME
HTML::Highlight - A module to highlight words or patterns in HTML documents SYNOPSIS
use HTML::Highlight; # create the highlighter object my $hl = new HTML::Highlight ( words => [ 'word', 'any', 'car', 'some phrase' ], wildcards => [ undef, '%', '*', undef ], colors => [ '#FF0000', 'red', 'green', 'rgb(255, 0, 0)' ], czech_language => 0, debug => 0 ); # Remember that you don't need to specify your own colors. # The default colors should be optimal. # Now you can use the object to highlight patterns in a document # by passing content of the document to its highlight() method. # The highlighter object "remembers" its configuration. my $highlighted_document = $hl->highlight($document); MOTIVATION
This module was originaly created to work together with fulltext indexing module DBIx::TextIndex to highlight search results. A need for a highlighter that takes wildcard matches and HTML tags into account and supports czech language (or other Slavic languages) was the motivation to create this module. DESCRIPTION
This module provides Google-like highlighting of words or patterns in HTML documents. This feature is typically used to highlight search results. The construcutor: my $hl = new HTML::Highlight ( words => [], wildcards => [], colors => [], czech_language => 0, debug => 0 ); This is a constructor of the highlighter object. It takes an array of even number of parameters. The words parameter is a reference to an array of words to highlight. The wildcards parameter is a reference to an array of wildcards, that are applied to corresponding words in the words array. A wildcard can be either undef or one of '%' or '*'. The "%" character means "match any characters": "%" applied to 'car' ==> matches "car", "cars", "careful", ... The "*" character means "match also plural form of the word": "*" applied to 'car' ==> matches only "car" or "cars" An undefined wildcard means "match exactly the corresponding word": undefined wildcard applied to 'car' ==> matches only "car" The colors parameter is a reference to an array of CSS color identificators, that are used to highlight the corresponding words in the words array. Default Google-like colors are used if you don't specify your own colors. Number of colors can be lower than number of words - in this case the colors are rotated and some of the words are therefore highlighted using the same color. The highlighter takes HTML tags into account and therefore does not "highlight" a word or a pattern inside a tag. A support for diacritics insenstive matching for ISO-8859-2 languages (for for example the czech language) can be activated using the czech_language option. This feature requires a module CzFast that is available on CPAN in a directory of author TRIPIE or at http://geocities.com/tripiecz/. Your system's locales must be set correctly to use the czech_language feature. highlight my $hl_document = $hl->highlight($document); The only parameter is a document in that you want to highlight the words that were passed to the constructor of the highlighter object. The method returns a version of the document in which the words are highlighted. preview_context my $sections = $hl->preview_context($document, $num); This method takes two parameters. The first one is the document you want to scan for the words that were passed to the constructor of the highlighter object. The second parameter is an optional integer that specifies maximum number of characters in each of the context sections (see below). This parameter defaults to 80 characters if it's not specified. Minimum allowed value of this parameter is 60. The method returns a reference to an array of sections of the document in which the words that were passed to the constructor appear. HTML tags are removed before the document is proccessed and are not present in the ouput. This feature is typically used in search engines to preview a context in which words from a search query appear in the resulting documents. The words are always in the middle of each of the sections. The number of sections this method returns is equal to the number of words passed to the constructor of the highlighter object. That means only the first occurence of each of the words is taken into account. SUPPORT
No official support is provided, but I welcome any comments, patches and suggestions on my email. BUGS
I am aware of no bugs. AVAILABILITY
http://geocities.com/tripiecz/ AUTHOR
Tomas Styblo, tripie@cpan.org, CPAN-ID TRIPIE Prague, the Czech republic LICENSE
HTML::Highlight - A module to highlight words or patterns in HTML documents Copyright (C) 2000 Tomas Styblo (tripie@cpan.org) This module is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" which comes with this module. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this module, in the file Artistic. If not, I'll be glad to provide one. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA SEE ALSO
perl(1). perl v5.10.0 2009-06-04 Highlight(3pm)
All times are GMT -4. The time now is 11:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy