In a Case switch, how to ignore case sensitive in the test:
e.g.
case "$field" in
"TEST) action1;;
*) action2;;
esac
How to go in action1 in case of $field = TEST , or Test , or test or .... without enumerating all possibilities...
Thanks,... (1 Reply)
HELLO ALL,
URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE.
FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY
and the CITY column records will be: Newyork
washington
... (1 Reply)
Hi,
In below code, i am expecting the output has
Bye
Bye
But i am getting has
Bye
Hi
Code:
#!/usr/bin/bash
var="Hi"
cat txt.txt | while read var1
do
next="Bye"
case $var in
Hi) (1 Reply)
I started writing a script to save the files from a camera I got the other day, which mounts in /Volumes , and I got into it and started building this menu. The only problem is that the switch case is coming up as a syntax error at the parenthesis after a case. Here is the code:
while :
do
... (2 Replies)
My switch case is not working properly. When I press 6 or 'r' it prints out all the names of the project and the error message.
#!/bin/bash
while true; do
read -p "Enter project number (1/2/3/10/20/30):" menu
#grabs the informations of the project number and stores it into a menu... (1 Reply)
Hi
Am pretty new to C..
Am trying to pass the arguments from command line and use them in switch case statement..
i have tried the following
#include <stdlib.h>
main(int argc, char* argv)
{
int num=0;
if ( argc == 2 )
num = argv;
printf("%d is the num value",num);
switch ( num )
... (2 Replies)
Hi All,
I have a requirement to write shell script in which we have to test three cases considering ip connection which differentiate the tool's name as per as the ip address in the file.txt .
<ip1>,<ip2>,<ip3> address belongs to Tool1
<ip4>,<ip5>,<ip6> address belongs to Tool2
if... (12 Replies)
Hi there,
I'm trying to run a simple script,but i'm always getting this error
Syntax error: word unexpected (expecting "in")I have searched many sites,like this,but i dont get it,it looks good so far,but wont work,maybe someone can help me.
Here is the Script
#!/bin/bash
while :
do... (6 Replies)
Discussion started by: JustAnUser
6 Replies
LEARN ABOUT DEBIAN
algorithm::checkdigits::m10_001
CheckDigits::M10_001(3pm) User Contributed Perl Documentation CheckDigits::M10_001(3pm)NAME
CheckDigits::M10_001 - compute check digits for Bahncard (DE), IMEI, IMEISV, ISIN, Miles&More, Payback (DE), Personnummer (SE), Passport
(BR), Credit Cards, SSN (US), Samordningsnummer (SE), VAT RN (ES), VAT RN (IT), VAT RN (SE), International Securities Identifikation Number
(ISIN)
SYNOPSIS
use Algorithm::CheckDigits;
$visa = CheckDigits('visa');
if ($visa->is_valid('4111 1111 1111 1111')) {
# do something
}
$cn = $visa->complete('4111 1111 1111 111');
# $cn = '4111 1111 1111 1111'
$cd = $visa->checkdigit('4111 1111 1111 1111');
# $cd = '7'
$bn = $visa->basenumber('4111 1111 1111 1111');
# $bn = '4111 1111 1111 111'
DESCRIPTION
ALGORITHM
1. Beginning right all numbers are weighted alternatively 1 and 2 (that is the check digit is weighted 1).
2. The total of the digits of all products is computed.
3. The sum of step 3 ist taken modulo 10.
4. The check digit is the difference between 10 and the number from step 3.
To validate the total of the digits of all numbers inclusive check digit taken modulo 10 must be 0.
METHODS
is_valid($number)
Returns true only if $number consists solely of numbers and the last digit is a valid check digit according to the algorithm given
above.
Returns false otherwise,
complete($number)
The check digit for $number is computed and concatenated to the end of $number.
Returns the complete number with check digit or '' if $number does not consist solely of digits and spaces.
basenumber($number)
Returns the basenumber of $number if $number has a valid check digit.
Return '' otherwise.
checkdigit($number)
Returns the checkdigit of $number if $number has a valid check digit.
Return '' otherwise.
EXPORT
None by default.
AUTHOR
Mathias Weidner, <mathias@weidner.in-bad-schmiedeberg.de>
SEE ALSO
perl, CheckDigits, www.pruefziffernberechnung.de.
For IMEI, IMEISV: ETSI Technical Specification TS 100 508 (v6.2.0)
perl v5.10.0 2008-05-17 CheckDigits::M10_001(3pm)