Sponsored Content
Top Forums Shell Programming and Scripting Help me streamline this counting part of my script. Post 302170729 by LinuxRacr on Tuesday 26th of February 2008 02:56:51 PM
Old 02-26-2008
Quote:
Originally Posted by joeyg
Code:
#         printf "%.2d \n" $CURRENT
         printf "%.2d \n" $CURRENT >>count.txt
         lv_val=$(printf "%.2d" $CURRENT)

The %.2d says to format for two digits, thus can allocate from device _02 to _99. If you want to be able to go past this, simply change the script to %.3d before you execute. (Your example seemed to skip over the possibility of a _01 device.)
However, I would find it unusual to think you would be configuring more than 99 devices.

Before implementing this or any other suggestions, strongly recommend 'trial runs' where you do not execute the commands, but display/print the commands you are about to run.
I totally agree. The output above from the script are just the commands echoed to screen. This clarifies a couple of things. Thanks for your replies!
 

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
DH_INSTALLDEBCONF(1)						     Debhelper						      DH_INSTALLDEBCONF(1)

NAME
dh_installdebconf - install files used by debconf in package build directories SYNOPSIS
dh_installdebconf [debhelperoptions] [-n] [--params] DESCRIPTION
dh_installdebconf is a debhelper program that is responsible for installing files used by debconf into package build directories. It also automatically generates the postrm commands needed to interface with debconf. The commands are added to the maintainer scripts by dh_installdeb. See dh_installdeb(1) for an explanation of how that works. Note that if you use debconf, your package probably needs to depend on it (it will be added to ${misc:Depends} by this program). Note that for your config script to be called by dpkg, your postinst needs to source debconf's confmodule. dh_installdebconf does not install this statement into the postinst automatically as it is too hard to do it right. FILES
debian/package.config This is the debconf config script, and is installed into the DEBIAN directory in the package build directory. Inside the script, the token #DEBHELPER# is replaced with shell script snippets generated by other debhelper commands. debian/package.templates This is the debconf templates file, and is installed into the DEBIAN directory in the package build directory. debian/po/ If this directory is present, this program will automatically use po2debconf(1) to generate merged templates files that include the translations from there. For this to work, your package should build-depend on po-debconf. OPTIONS
-n, --no-scripts Do not modify postrm script. -- params Pass the params to po2debconf. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 11.1.6ubuntu2 2018-05-10 DH_INSTALLDEBCONF(1)
All times are GMT -4. The time now is 10:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy