![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
how can I print A to Z using for loop or If condition.
Exmp: I have one file name 098A. I run one script which check that file name Now every time one script run the file name(098A) will change and it will look like 098B then 098C.... the atlast 098Z. please help me. |
|
||||
|
Quote:
Looking for something like this, Just to store, Code:
awk '{ for(i=65; i<=90; i++) { arr[i]=i } }' /bin/ls
Code:
awk '{ for(i=65; i<=90; i++) { arr[i]=i } }END{ for ( i in arr ) { printf "%d %c\n", i, arr[i] } }' /bin/ls
|
|
||||
|
awk '{ for(i=65; i<=90; i++) { arr[i]=i } }END{ for ( i in arr ) { printf "%d %c\n", i, arr[i] } }' /bin/ls
output of this is:::: 70 F 71 G 72 H 73 I 74 J 75 K 76 L 77 M 78 N 79 O 90 Z 65 A 66 B 67 C 68 D 69 E 80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W 88 X 89 Y Why it is not giving in proper way. can I get A to Z serially. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|