Sponsored Content
Full Discussion: Beginning learner
Top Forums Shell Programming and Scripting Beginning learner Post 303000316 by shiver on Monday 10th of July 2017 01:48:50 AM
Old 07-10-2017
Beginning learner

Hi guys,

New member here, also new student!

I'm just starting the Shell Programming, currently in chapter four in the Book in Unix, Linux, and OS X by Stephen G. Kochan & Patrick Wood (4th edition).

I'm needing a little help with other possible ways to shorten this shell command:
Code:
/[0-9][0-9][0-9][0-9][ \][0-9][0-9][0-9][0-9][0-9][0-9][ \][0-9][0-9][0-9][0-9][0-9]/

It's purpose is to bed used in ed with a file open with possible matches.

This question was presented as follows:

Using the Regular Expression techniques that we have discussed in class develop, test, and submit a regular expression that will identify each of the following patterns.

An American Express credit card number that fits the following format: 4 digits followed by a space followed by 6 digits followed by a space followed by 5 digits.

Any input or help would be greatly appreciated!

If not, I'm happy to be a member here! Smilie

Thanks

Moderator's Comments:
Mod Comment Please use code tags for you code and data, as requested by our forum rules, thanks

Last edited by vbe; 07-10-2017 at 03:19 AM.. Reason: code tags please even for so lttle...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I am a fresh learner of unix,and hope for some help here.

Who could tell me how to learn unix fastly? (4 Replies)
Discussion started by: dsun5
4 Replies

2. IP Networking

Apache: In the beginning...

:D Hello Everyone, This is my first post on this forum, and I a already like it :-) As you can tell I am a complete newbie to Apache. My mission is to setup a web server on my Suse Linux 8.1 box, initially for test purposes, and then if my ISP provider permits, then to allow other poeple... (10 Replies)
Discussion started by: bionicfysh
10 Replies

3. UNIX for Dummies Questions & Answers

beginning unix

i am fairly new to unix, and i would want a very simple, small command-line operating system to learn as much as possible. are there any good ones? i have a fairly old laptop w/ about 700 MB, running windows 95. i would like to partition it, anyone know how to do that? any help is very much... (1 Reply)
Discussion started by: henroid815
1 Replies

4. UNIX for Dummies Questions & Answers

the very beginning

Actually, I had my first problem before even BEGINNING using my FreeBSD. The installation guide said I should run the rawrite tool and should do something like A> rawrite if i put the the file I want to image-copy and the rawrite.exe in the same directory somewhere. OK done that. Next it asks... (6 Replies)
Discussion started by: Mudrack
6 Replies

5. Post Here to Contact Site Administrators and Moderators

Thread closed when learner has tried

I'm not so sure that this thread should have been closed. Though it was clearly homework the student was asking a specific question related to the assignment, but not the answer to the whole assignment. /www.unix.com/unix-dummies-questions-answers/107494-how-get-rid.html . IMHO The solution is... (1 Reply)
Discussion started by: methyl
1 Replies

6. Shell Programming and Scripting

i am new learner from shell scripting.. any one help me.

hi every body, i am ramesh. i want write about this shell program (" i have 94 server's like aix, solaris, linux, hp-ux, and sco unix-") how to get mail's from these server's? (i have personal linux system)- i want to run this program in my personal linux system continuously. i want to... (4 Replies)
Discussion started by: rameshreddy.ema
4 Replies

7. Programming

Beginning C++

I want to learn C++ ! :) I have basic programming knowledge with python and perl. Does anyone know of any great beginner tutorials for C++? (1 Reply)
Discussion started by: cbreiny
1 Replies

8. Red Hat

learner Shell

a task given to me is to make a shell which will have the following qualities.... "The most rudimentary shell is structured as the following loop: 1. Print out a prompt (e.g., "OS_Spring2011_Shell$ "); 2. Read a line from the user; 3. Parse the line into the program name and an array of... (2 Replies)
Discussion started by: hamidnasir
2 Replies

9. AIX

Learner FTP help

Hello All, Real Newbie to AIX I need to automate an FTP server to Server. Want to push the files from an AIX server to an OSX server. What would be the best command in AIX to do this? Need help copying contents of \UVdata to 172.16.12.2\ERAbackup\1 Or Alternatively would it be better... (1 Reply)
Discussion started by: Joelly
1 Replies

10. Shell Programming and Scripting

beginning less from line #

Hi from a script i want to to read a file beginning at line e.g. number 21 to the EOF. less +n21 temp.txt Bevor the result, it brings an empty page, so that i cant use for scripting. Any idea how the problem can be solved? Thanks in advance! IMPe (2 Replies)
Discussion started by: IMPe
2 Replies
CreditCard(3pm) 					User Contributed Perl Documentation					   CreditCard(3pm)

NAME
"Business::CreditCard" - Validate/generate credit card checksums/names SYNOPSIS
use Business::CreditCard; print validate("5276 4400 6542 1319"); print cardtype("5276 4400 6542 1319"); print generate_last_digit("5276 4400 6542 131"); Business::CreditCard is available at a CPAN site near you. DESCRIPTION
These subroutines tell you whether a credit card number is self-consistent -- whether the last digit of the number is a valid checksum for the preceding digits. The validate() subroutine returns 1 if the card number provided passes the checksum test, and 0 otherwise. The cardtype() subroutine returns a string containing the type of card. The list of possible return values is more comprehensive than it used to be, but additions are still most welcome. Possible return values are: VISA card MasterCard Discover card American Express card enRoute JCB BankCard Switch Solo China Union Pay Laser Unknown "Not a credit card" is returned on obviously invalid data values. Versions before 0.31 may also have returned "Diner's Club/Carte Blanche" (these cards are now recognized as "Discover card"). As of 0.30, cardtype() will accept a partial card masked with "x", "X', ".", "*" or "_". Only the first 2-6 digits and the length are significant; whitespace and dashes are removed. To recognize just Visa, MasterCard and Amex, you only need the first two digits; to recognize almost all cards except some Switch cards, you need the first four digits, and to recognize all cards including the remaining Switch cards, you need the first six digits. The generate_last_digit() subroutine computes and returns the last digit of the card given the preceding digits. With a 16-digit card, you provide the first 15 digits; the subroutine returns the sixteenth. This module does not tell you whether the number is on an actual card, only whether it might conceivably be on a real card. To verify whether a card is real, or whether it's been stolen, or to actually process charges, you need a Merchant account. See Business::OnlinePayment. These subroutines will also work if you provide the arguments as numbers instead of strings, e.g. "validate(5276440065421319)". PROCESSING AGREEMENTS
Credit card issuers have recently been forming agreements to process cards on other networks, in which one type of card is processed as another card type. By default, Business::CreditCard returns the type the card should be treated as in the US and Canada. You can change this to return the type the card should be treated as in a different country by setting $Business::CreditCard::Country to your two-letter country code. This is probably what you want to determine if you accept the card, or which merchant agreement it is processed through. You can also set $Business::CreditCard::Country to a false value such as the empty string to return the "base" card type. This is probably only useful for informational purposes when used along with the default type. Here are the currently known agreements: Most Diner's club is now identified as Discover. (This supercedes the earlier identification of some Diner's club cards as MasterCard inside the US and Canada.) JCB cards in the 3528-3589 range are identified as Discover inside the US and Canada. China Union Pay cards are identified as Discover cards outside China. NOTE ON INTENDED PURPOSE
This module is for verifying real world credit cards. It is NOT a pedantic implementation of the ISO 7812 standard, a general-purpose LUHN implementation, or intended for use with "creditcard-like account numbers". AUTHOR
Jon Orwant The Perl Journal and MIT Media Lab orwant@tpj.com Current maintainer is Ivan Kohler <ivan-business-creditcard@420.am>. Please don't bother Jon with emails about this module. Lee Lawrence <LeeL@aspin.co.uk>, Neale Banks <neale@lowendale.com.au> and Max Becker <Max.Becker@firstgate.com> contributed support for additional card types. Lee also contributed a working test.pl. Alexandr Ciornii <alexchorny@gmail.com> contributed code cleanups. COPYRIGHT AND LICENSE
Copyright (C) 1995,1996,1997 Jon Orwant Copyright (C) 2001-2006 Ivan Kohler Copyright (C) 2007-2009 Freeside Internet Services, Inc. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. SEE ALSO
Business::CreditCard::Object is a wrapper around Business::CreditCard providing an OO interface. Assistance integrating this into the base Business::CreditCard distribution is welcome. Business::OnlinePayment is a framework for processing online payments including modules for various payment gateways. perl v5.10.0 2009-09-28 CreditCard(3pm)
All times are GMT -4. The time now is 04:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy