help: single digits inflated to 2 digits


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help: single digits inflated to 2 digits
Prev   Next
# 1  
Old 01-13-2010
help: single digits inflated to 2 digits

Hi Folks
Probably an easy one here but how do I get a sequence to get used as mentioned. For example in the following I want to automatically create files that have a 2 digit number at the end of their names:

Code:
m@pyhead:~$ for x in $(seq 00 10); do touch file_$x; done
m@pyhead:~$ ls file*
file_0  file_10  file_3  file_5  file_7  file_9
file_1  file_2   file_4  file_6  file_8
m@pyhead:~$

So instead of file_0 I want file_00, and so forth. What am I doing wrong?

Thanks
A
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

sed / awk script to delete the two digits from first 3 digits

Hi All , I am having an input file as stated below 5728 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r03_q_reg_20_/Q 011 611 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r04_q_reg_20_/Q 011 3486... (4 Replies)
Discussion started by: kshitij
4 Replies

2. Shell Programming and Scripting

Splitting single row into multiple rows based on for every 10 digits of last field of the row

Hi ALL, We have requirement in a file, i have multiple rows. Example below: Input file rows 01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212 01,1,102319,0,1,80,20,U,1,241,00000059420000006021 I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies

3. Shell Programming and Scripting

Showing 4 digits

Hello everybody I'm a little beginer for shell script as I started last night... I have this script cat fichier.txt | while read l ; do #echo $l echo $x x=$(( $x + 1 )) done it's return 1 2 3 4 (4 Replies)
Discussion started by: remibemol
4 Replies

4. Programming

6 digits combination

Is there any program that can create 6 digit numbers with: (DIGIT_1)+(DIGIT_2)+(DIGIT_3)+(DIGIT_4)+(DIGIT_5)+(DIGIT_6)=10 Any perl or C also can. Anyone can help me? Thank you (6 Replies)
Discussion started by: Tzeronone
6 Replies

5. UNIX for Advanced & Expert Users

How to replace last 8 digits?

Hi, How I can replace last 8 ZEROS with 22991231? 19523479811841494432A2013052700000000 19523479811730333980A2013052700000000 19523479811417044397A2013052700000000 19523479811205895810C2013010120130131 A9523479811205895810A2013020120130228 19523479811205895810I2013030120130331... (9 Replies)
Discussion started by: jnrohit2k
9 Replies

6. Shell Programming and Scripting

Find filenames with three digits and add zeros to make five digits

Hello all! I've looked all over the internet and this site and have come up a loss with an easy way to make a bash script to do what I want to do. I have a file with a naming convention as follows: 2012-01-18 string of words here 123.jpg 2012-01-18 string of words here 1234.jpg 2012-01-18... (2 Replies)
Discussion started by: Buzzman25
2 Replies

7. Shell Programming and Scripting

total last digits

hi group, How can I count total number of 5's which are continuous in the end. i.e. in the below string, the o/p should be 4 I just know to calculate total number of 5's $ echo "95952325555" | awk -F "5" '{print NF-1}' 6 (3 Replies)
Discussion started by: uwork72
3 Replies

8. Shell Programming and Scripting

adding zeroes to all single digits

I have got a file that contains both single and double digits like this 10 3 48 39 20 6 8 and i want to add zeros in front of every single digit to become double digits like this 10 03 48 39 20 06 08 I tried using Sed sed 's/\(\)/0&/g' filename or sed 's/\(\)*/0&/g' filename but i... (3 Replies)
Discussion started by: ganiel24
3 Replies

9. UNIX for Dummies Questions & Answers

Digits display

Hi there, I am new to scripting. Can anyone help me in writing a script which will display all the digits between 1 and 5 inclusive, one digit per line. Should use a loop to do this. Thanks in advance!! (3 Replies)
Discussion started by: Spoorthi16
3 Replies

10. UNIX for Dummies Questions & Answers

Only Digits as input

Hi All, I am new to shell script. I wrote a very small script that takes only digits as input- but there is some problem in that.can you help me in debugging that. #!/bin/ksh echo "Digits as input" read number digit='eval ' if ] then echo "Entered number is a digit" else echo... (2 Replies)
Discussion started by: namishtiwari
2 Replies
Login or Register to Ask a Question
CheckDigits::M09_001(3pm)				User Contributed Perl Documentation				 CheckDigits::M09_001(3pm)

NAME
CheckDigits::M09_001 - compute check digits for Euro notes SYNOPSIS
use Algorithm::CheckDigits; $euro = CheckDigits('euronote'); if ($euro->is_valid('X07738250357')) { # do something } $cn = $euro->complete('X0773825035'); # $cn = 'X07738250357' $cd = $euro->checkdigit('X07738250357'); # $cd = '7' $bn = $euro->basenumber('X07738250357'); # $bn = 'X0773825035' DESCRIPTION
ALGORITHM 1. Letters are replaced with their position in the alphabet ('A' = 1, ...). 2. The total of the digits of all numbers is computed. 3. This sum is taken modulo 9. 4. The check digit is the difference between 8 and the number of step 3. To validate the last digit of the total of the digits of all numbers inclusive check digit must be 8. 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. 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. perl v5.10.0 2008-05-17 CheckDigits::M09_001(3pm)