Sponsored Content
Top Forums Shell Programming and Scripting Bash conditional | getting logic wrong? Post 302780137 by the_gripmaster on Thursday 14th of March 2013 01:48:31 AM
Old 03-14-2013
Is there a way to shorten snippet 2?
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash passes flags to shell wrong

Hi, first post, so hello to all. I have a Bash scripting problem that is driving me a bit nutty. It involves a program called 'convert' which is part of the ImageMagick collection. Normal usage from the commandline is: $ convert -resize 120x120 inputfile.jpg outputfile.jpg This is... (7 Replies)
Discussion started by: andyj
7 Replies

2. Shell Programming and Scripting

what's wrong with my bash script?

hi, please point out what's wrong with my script. im feeding it a list containing fqdn, sit should ssh into each and verify that atleast one of its virtual backup ip resolves into one of its virtual hostnames .. anyway the objective shows in the script... however, im having problems in the ... (4 Replies)
Discussion started by: ikk
4 Replies

3. Shell Programming and Scripting

Please help to fingure out what wrong with my tomcat restarting bash script

Hi, I am a nbee to Unix, I have used following script to check my tomcat is running or not and restart if it down. but actually it restart my tomcat each time running even my tomcat still running fine: Script that can run a check and perform an action if the check fails ... (1 Reply)
Discussion started by: quyennd
1 Replies

4. UNIX for Dummies Questions & Answers

Conditional statement in bash

I want to combine 2 conditional statements by using -o in bash, but it won't work. if ; then echo "The number needs to be between 0 and $nr" fi Each time i execute the file it says: ./selectCitaat: line 10: syntax error near unexpected token `$1' (3 Replies)
Discussion started by: doc.arne
3 Replies

5. UNIX for Advanced & Expert Users

Bash conditional prompt?

Hi, Does anyone know any way of making bash prompt extended with conditional content? Example: export PS1="] && echo '#' || echo '\$'" # This won't work - prompt is not executed # export PS1="\$" # This is an existing but also working equivalent I would like to use more complex... (8 Replies)
Discussion started by: adderek
8 Replies

6. Shell Programming and Scripting

What's wrong with my bash code?

I want to let sleep 3 in the background and echo $i pkglists="a b c d e f g" f() { local i set -- $pkglists && ((i +=2)) && sleep 3 &;echo $i } f (3 Replies)
Discussion started by: yanglei_fage
3 Replies

7. Shell Programming and Scripting

Conditional bash/mysql query help

I think(hope) I've got a simple one - I just need to send an email if a mysql query returns any results (ideally - it will never match). Currently I just pipe the mysql query output to the mail program, but of course that emails regardless of the output( and I check this every 10 minutes from... (5 Replies)
Discussion started by: jcass78
5 Replies
ExtUtils::XSSymSet(3perl)				 Perl Programmers Reference Guide				 ExtUtils::XSSymSet(3perl)

NAME
ExtUtils::XSSymSet - keep sets of symbol names palatable to the VMS linker SYNOPSIS
use ExtUtils::XSSymSet; $set = new ExtUtils::XSSymSet; while ($sym = make_symbol()) { $set->addsym($sym); } foreach $safesym ($set->all_trimmed) { print "Processing $safesym (derived from ",$self->get_orig($safesym),") "; do_stuff($safesym); } $safesym = ExtUtils::XSSymSet->trimsym($onesym); DESCRIPTION
Since the VMS linker distinguishes symbols based only on the first 31 characters of their names, it is occasionally necessary to shorten symbol names in order to avoid collisions. (This is especially true of names generated by xsubpp, since prefixes generated by nested package names can become quite long.) "ExtUtils::XSSymSet" provides functions to shorten names in a consistent fashion, and to track a set of names to insure that each is unique. While designed with xsubpp in mind, it may be used with any set of strings. This package supplies the following functions, all of which should be called as methods. new([$maxlen[,$silent]]) Creates an empty "ExtUtils::XSSymset" set of symbols. This function may be called as a static method or via an existing object. If $maxlen or $silent are specified, they are used as the defaults for maximum name length and warning behavior in future calls to addsym() or trimsym() via this object. If the compiler has been instructed to do its own symbol shortening via $Config{'useshortenedsymbols'}, a value of 2048 is assumed for $maxlen as a way of bypassing the shortening done by this module. addsym($name[,$maxlen[,$silent]]) Creates a symbol name from $name, using the methods described under trimsym(), which is unique in this set of symbols, and returns the new name. $name and its resultant are added to the set, and any future calls to addsym() specifying the same $name will return the same result, regardless of the value of $maxlen specified. Unless $silent is true, warnings are output if $name had to be trimmed or changed in order to avoid collision with an existing symbol name. $maxlen and $silent default to the values specified when this set of symbols was created. This method must be called via an existing object. trimsym($name[,$maxlen[,$silent]]) Creates a symbol name $maxlen or fewer characters long from $name and returns it. If $name is too long, it first tries to shorten it by removing duplicate characters, then by periodically removing non-underscore characters, and finally, if necessary, by periodically removing characters of any type. $maxlen defaults to 31. Unless $silent is true, a warning is output if $name is altered in any way. This function may be called either as a static method or via an existing object, but in the latter case no check is made to insure that the resulting name is unique in the set of symbols. If the compiler has been instructed to do its own symbol shortening via $Config{'useshortenedsymbols'}, a value of 2048 is assumed for $maxlen as a way of bypassing the shortening done by this module. delsym($name) Removes $name from the set of symbols, where $name is the original symbol name passed previously to addsym(). If $name existed in the set of symbols, returns its "trimmed" equivalent, otherwise returns "undef". This method must be called via an existing object. get_orig($trimmed) Returns the original name which was trimmed to $trimmed by a previous call to addsym(), or "undef" if $trimmed does not correspond to a member of this set of symbols. This method must be called via an existing object. get_trimmed($name) Returns the trimmed name which was generated from $name by a previous call to addsym(), or "undef" if $name is not a member of this set of symbols. This method must be called via an existing object. all_orig() Returns a list containing all of the original symbol names from this set. all_trimmed() Returns a list containing all of the trimmed symbol names from this set. AUTHOR
Charles Bailey <bailey@newman.upenn.edu> REVISION
Last revised 8-Oct-2010, for Perl 5.13.6. perl v5.14.2 2011-09-19 ExtUtils::XSSymSet(3perl)
All times are GMT -4. The time now is 09:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy