Sponsored Content
Full Discussion: Help Please...........
Top Forums Shell Programming and Scripting Help Please........... Post 302127128 by Shell_Life on Monday 16th of July 2007 09:30:39 AM
Old 07-16-2007
Pbsrinivas,
Quote:
b=$b+1 wont it be a string concat..?
No. The OP says he wants to add one to the 'b' variable.
Thus the assumption is that 'b' is defined as integer:
Code:
typeset -i b

Quote:
how to retain the zeros
See the following code:
Code:
typeset -i b
typeset -Z7 bOut
b=123
bOut=$b
echo "b = "$b" bOut = "$bOut

Thanks for asking, Pbsrinivas. Smilie
 
LESSECHO(1)						      General Commands Manual						       LESSECHO(1)

NAME
lessecho - expand metacharacters SYNOPSIS
lessecho [-ox] [-cx] [-pn] [-dn] [-mx] [-nn] [-ex] [-a] file ... DESCRIPTION
lessecho is a program that simply echos its arguments on standard output. But any metacharacter in the output is preceded by an "escape" character, which by default is a backslash. OPTIONS
A summary of options is included below. -ex Specifies "x", rather than backslash, to be the escape char for metachars. If x is "-", no escape char is used and arguments con- taining metachars are surrounded by quotes instead. -ox Specifies "x", rather than double-quote, to be the open quote character, which is used if the -e- option is specified. -cx Specifies "x" to be the close quote character. -pn Specifies "n" to be the open quote character, as an integer. -dn Specifies "n" to be the close quote character, as an integer. -mx Specifies "x" to be a metachar. By default, no characters are considered metachars. -nn Specifies "n" to be a metachar, as an integer. -fn Specifies "n" to be the escape char for metachars, as an integer. -a Specifies that all arguments are to be quoted. The default is that only arguments containing metacharacters are quoted SEE ALSO
less(1) AUTHOR
This manual page was written by Thomas Schoepf <schoepf@debian.org>, for the Debian GNU/Linux system (but may be used by others). Send bug reports or comments to bug-less@gnu.org. Version 458: 04 Apr 2013 LESSECHO(1)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy