Sponsored Content
Homework and Emergencies Homework & Coursework Questions problem in a shell based project Post 302472510 by palsevlohit_123 on Wednesday 17th of November 2010 09:59:15 AM
Old 11-17-2010
Before making the old -> new, put a conditional check for the input with a counter.

1. use something like below for the validation
echo "asbc123" | tr -dc '[:alpha:]' #if something return its invalid

2. for each try increament the counter
check if the step1 not returning anything & step2<=3
proceed
else
do nothing
This User Gave Thanks to palsevlohit_123 For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

project idia in shell

could any one provide me any new real time project idea in shell scripting i am learning shell script and wants to do some real time development . (1 Reply)
Discussion started by: useless79
1 Replies

2. Programming

Problem with kerberos cpp project

Hi All, I am having problem with kerberos kadmin library in c++. I am using red hat linux Enterprise Linux Server release 5 (Tikanga), and gcc c++ - 4.1.1-52.el4.i386. When I make a c project (main.c) and use function from kadmin library such as kadm5_init_krb5_context(&context); ... (2 Replies)
Discussion started by: amitp
2 Replies

3. Solaris

building solaris-based enterprise router-firewall project

hi guys, its been a while since my last visit here, could not keep up the pace on this ever changing industry :) i'd just doing my home research under vmware to make a solaris-based router-firewall using zones - doing a lot of reading about zones & review solaris zone functionality. and... (4 Replies)
Discussion started by: stdout
4 Replies

4. Hardware

Need ideas for graduation project based on unix or linux

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

5. UNIX and Linux Applications

Need ideas for graduation project based on unix or linux Need ideas for graduation project based on

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

6. UNIX for Advanced & Expert Users

Need ideas for graduation project based on unix or linux

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

7. Homework & Coursework Questions

Need ideas for graduation project based on unix or linux

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

8. Solaris

Solaris based project?

Hi friends, I am a Computer Science student, and about to do my final year project. I am a big lover of Solaris and SPARC RISC computers, and I want to work on those computers in future. I want to become a System Administrator/Security Administrator etc on the Solaris stuff. Could you please tell... (1 Reply)
Discussion started by: gabam
1 Replies

9. Open Source

Project planing - with Linux based solutions

Hello, Please suggest or share any of your experience for the following requests: Request: 1. Creation of the local network. The company will be in the field of IT. 10-15 persons. 10 will be physically in the office. The local network should be secured and all the files and... (0 Replies)
Discussion started by: AQwert
0 Replies
Vend::CounterFile(3pm)					User Contributed Perl Documentation				    Vend::CounterFile(3pm)

NAME
Vend::CounterFile - Persistent counter class SYNOPSIS
use Vend::CounterFile; $c = new Vend::CounterFile "COUNTER", "aa00"; $id = $c->inc; open(F, ">F$id"); DESCRIPTION
(This module is modified from Gisle Aas File::CounterFile to use Interchange's locking protocols -- lack of fcntl locking was causing counter problems.) This module implements a persistent counter class. Each counter is represented by a separate file in the file system. File locking is applied, so multiple processes might try to access the same counters at the same time without risk of counter destruction. You give the file name as the first parameter to the object constructor ("new"). The file is created if it does not exist. If the file name does not start with "/" or ".", then it is interpreted as a file relative to $Vend::CounterFile::DEFAULT_DIR. The default value for this variable is initialized from the environment variable "TMPDIR", or /usr/tmp is no environment variable is defined. You may want to assign a different value to this variable before creating counters. If you pass a second parameter to the constructor, that sets the initial value for a new counter. This parameter only takes effect when the file is created (i.e. it does not exist before the call). When you call the "inc()" method, you increment the counter value by one. When you call "dec()" the counter value is decrementd. In both cases the new value is returned. The "dec()" method only works for numerical counters (digits only). You can peek at the value of the counter (without incrementing it) by using the "value()" method. The counter can be locked and unlocked with the "lock()" and "unlock()" methods. Incrementing and value retrieval is faster when the counter is locked, because we do not have to update the counter file all the time. You can query whether the counter is locked with the "locked()" method. There is also an operator overloading interface to the Vend::CounterFile object. This means that you might use the "++" operator for incrementing the counter, "--" operator for decrementing and you can interpolate counters diretly into strings. BUGS
(This problem alleviated by this modified module) It uses flock(2) to lock the counter file. This does not work on all systems. Perhaps we should use the File::Lock module? COPYRIGHT
Copyright (c) 1995-1998 Gisle Aas. All rights reserved. Modifications made by and copyright (C) 2002 Red Hat, Inc. and (c) 2002-2007 Interchange Development Group This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Gisle Aas <aas@sn.no> perl v5.14.2 2010-03-25 Vend::CounterFile(3pm)
All times are GMT -4. The time now is 10:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy