Sponsored Content
Top Forums UNIX for Advanced & Expert Users [bash] variables and if conditions Post 302574023 by vbe on Wednesday 16th of November 2011 09:37:06 AM
Old 11-16-2011
Should this not be:
Code:
if ( $archive_type=z ); then         
   archive_type_0="gz"          
fi                    
if ( $archive_type=j )
then          
    archive_type_0="bz2"          
fi

In other words look where you have placed the $ sign...
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

bash shell variables

Hi everyone, I have added this to my .bash_profile. Whenever I log in and when I type javac I get a error message (java: command not found). Does the order counts? PATH=$JAVA_HOME/bin:$PATH:$HOME/bin JAVA_HOME=$JAVA_HOME/usr/local/jdk1.3.1_02 export JAVA_HOME PATH Thanks ny (3 Replies)
Discussion started by: xNYx
3 Replies

2. Shell Programming and Scripting

Bash variables

Ummm can anybody help me with this one? Its prob quite simple. I bascially have a file name say J1x2x3x7.dat Im using the file name as a variable in a bash script. Want I want to do is extract most of the file name and make it a new variable expect with say one of the number now a... (2 Replies)
Discussion started by: RichieFondel
2 Replies

3. Shell Programming and Scripting

while loops and variables under bash

Hi, This is probably going to be very simple but i came across something i can't quite explain. Here is the situation: i have a list of files, which i'd like to process one by one (get the size, make some tests, whatever) and generate some statistics using different variables. Something... (5 Replies)
Discussion started by: m69w
5 Replies

4. Shell Programming and Scripting

functions and variables in bash

I have a bash script with some functions as below and am wondering if I can use the variables declared in setup in the other functions and in the rest of the bash script. setup(){ none=0; low=1; medium=2; high=3; debug=4 var1="red" var2="fred" } create_basemap() { ... (7 Replies)
Discussion started by: kristinu
7 Replies

5. Shell Programming and Scripting

BASH arrays and variables of variables in C++

Sometimes it is handy to protect long scripts in C++. The following syntax works fine for simple commands: #define SHELLSCRIPT1 "\ #/bin/bash \n\ echo \"hello\" \n\ " int main () { cout <<system(SHELLSCRIPT1); return 0; } Unfortunately for there are problems for: 1d arrays:... (10 Replies)
Discussion started by: frad
10 Replies

6. Shell Programming and Scripting

Expect - bash and variables

I was wondering if anyone could provide some assistance. I trying to run an expect script within bash and get the results of a variable called RESULT. I Have tried a few things but none of them have worked. I know that the child process (the expect script) in this instance cannot set a variable... (6 Replies)
Discussion started by: ylafont
6 Replies

7. Shell Programming and Scripting

Passing awk variables to bash variables

Trying to do so echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies

8. Shell Programming and Scripting

Bash: How to use read with conditions & loops

Hello, Below I try to control that the input is good an IP : #!/bin/bash cp /home/scripts/choice_interfaces.txt /home/scripts/interfaces.txt chmod 644 /home/scripts/interfaces.txt echo -e "Please enter the network informations into the /etc/network/interfaces file, complete them below... (9 Replies)
Discussion started by: Arnaudh78
9 Replies

9. Shell Programming and Scripting

awk to assign points to variables based on conditions and update specific field

I have been reading old posts and trying to come up with a solution for the below: Use a tab-delimited input file to assign point to variables that are used to update a specific field, Rank. I really couldn't find too much in the way of assigning points to variable, but made an attempt at an awk... (4 Replies)
Discussion started by: cmccabe
4 Replies
Lingua::Stem::Da(3pm)					User Contributed Perl Documentation				     Lingua::Stem::Da(3pm)

NAME
Lingua::Stem::Da - Stemming algorithm for Danish SYNOPSIS
use Lingua::Stem::Da; my $stems = Lingua::Stem::Da::stem({ -words => $word_list_reference, -locale => 'da', -exceptions => $exceptions_hash, }); DESCRIPTION
This routine applies a stemming slgorithm to a passed anon array of Danish words, returning the stemmed words as an anon array. It is a 'convienence' wrapper for 'Lingua::Stem::Snowball::Da' that provides a standardized interface and caching. CHANGES
1.01 2003.09.28 - Documentation fix. 1.00 2003.04.05 - Initial release METHODS
stem({ -words => @words, -locale => 'da', -exceptions => \%exceptions }); Stems a list of passed words using the rules of Danish. Returns an anonymous array reference to the stemmed words. Example: my $stemmed_words = Lingua::Stem::Da::stem({ -words => @words, -locale => 'da', -exceptions => \%exceptions, }); stem_caching({ -level => 0|1|2 }); Sets the level of stem caching. '0' means 'no caching'. This is the default level. '1' means 'cache per run'. This caches stemming results during a single call to 'stem'. '2' means 'cache indefinitely'. This caches stemming results until either the process exits or the 'clear_stem_cache' method is called. clear_stem_cache; Clears the cache of stemmed words NOTES
This code is a wrapper around Lingua::Stem::Snowball::Da written by Dennis Haney <davh@davh.dk> and Ask Solem Hoel, <ask@unixmonks.net> (Swedish version) SEE ALSO
Lingua::Stem Lingua::Stem::Snowball::Da AUTHOR
Integration in Lingua::Stem by Benjamin Franz, FreeRun Technologies, snowhare@nihongo.org or http://www.nihongo.org/snowhare/ COPYRIGHT
Benjamin Franz, FreeRun Technologies This code is freely available under the same terms as Perl. BUGS
TODO
perl v5.10.1 2007-10-23 Lingua::Stem::Da(3pm)
All times are GMT -4. The time now is 08:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy