Sponsored Content
Top Forums Shell Programming and Scripting Help me streamline this counting part of my script. Post 302170497 by LinuxRacr on Monday 25th of February 2008 06:40:42 PM
Old 02-25-2008
Quote:
Originally Posted by joeyg
Code:
case $NUMBER
   in
      1)  continue ;;
      2) alphabet="02"
          count=0 ;;
      3) alphabet="02 03"
          count=0 ;;
      4) alphabet="02 03 04"
          count=0 ;;
      5) alphabet="02 03 04 05"
          count=0 ;;
      6) alphabet="02 03 04 05 06"
          count=0 ;;
      7) alphabet="02 03 04 05 06 07"
          count=0 ;;
      8) alphabet="02 03 04 05 06 07 08"
          count=0 ;;
esac

Fixed it...

Thanks for the reply. It definitely takes up less space, but I am still limited to a count of 8. I could add more lines, but I don't want to be limited by the number of lines I have in the file.

Last edited by LinuxRacr; 02-26-2008 at 03:09 AM..
 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

counting in shell script

hi i am writing a korn shell script to compile all programs there are arount 2000+ files now i have a script that can compile programs but i want to show status of compilation because to compile all programs it takes around 10-15 mins so how can i display status like it should print no of files... (3 Replies)
Discussion started by: zedex
3 Replies

2. Shell Programming and Scripting

Streamline script to search for numbers in a certain range

Hello all, I need help making a script run faster since I have a huge file to sift through. The file I am running my script on looks like this: 1 -1.9E+001 -1.8E-001 1.5E+001 3.32E+001 2 -1.7E+001 -1.0E-002 1.2E+001 6.37E+001 3 -1.5E+001 -3.8E-006 6.7E+001 4.81E+001 The... (12 Replies)
Discussion started by: butson
12 Replies
script(1)							   User Commands							 script(1)

NAME
script - make record of a terminal session SYNOPSIS
script [-a] [filename] DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the record is saved in the file typescript. See WARNINGS. The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends when the forked shell exits or when Control-d is typed. OPTIONS
The following option is supported: -a Appends the session record to filename, rather than overwriting it. NOTES
script places everything that appears on the screen in filename, including prompts. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a privileged user, that is, root. Be sure that typescript is not a link before running script. SunOS 5.11 30 Jan 2004 script(1)
All times are GMT -4. The time now is 04:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy