My requirement is need to add spaces to the string with the dynamic value to printf... this is a part of shell script ..which i have , the length is not static ...
---------- Post updated 04-18-13 at 02:14 AM ---------- Previous update was 04-17-13 at 08:22 AM ----------
Hi guru...
typeset worked when the "value" has some value in it...
if the value sometimes empty ... then it should create the passed length zero's...
But typeset is giving spaces ...Help me on this
If this isn't working, you must be using an 1988 version of ksh . If you are on a Solaris/SunOS system, you could try /usr/xpg4/bin/sh or /usr/xpg6/bin/sh to get a 1993 version of ksh . You could also look for a ksh93 utility to use instead of plain ksh . Even if the ksh built-in printf doesn't recognize format specifiers like %0*d , there might be a /bin/printf or /usr/bin/printf that does understand what to do with it.
i want to find a string/number variable value length...
ex:
value=value=`echo "$i_line1" | cut -d"|" -f4` ( this will be from run time .. i mean reading this value from another file which is pipe delimiter)
value_len=`echo "$value\c" | wc -m`
if value is empty.. it is stil giving value_len as 15...
it should be empty ...not sure what is the problem
---------- Post updated at 05:51 AM ---------- Previous update was at 04:52 AM ----------