From: Lal, Neeraj (Neeraj.Lal@Pfizer.com)
Date: Thu Sep 12 2002 - 18:19:07 EDT
Thanks for a quick response and thanks to Wu Andrew & Serge Dubrouski
it worked for me here are the answer
rintf "%7d\n" ${A}
# export A=12345
# printenv A
12345
# printf "%7d\n" ${A}
12345
#
Serge Dubrouski
a=12345
b="`echo $a | awk '{ printf "%7d",$1;}'`"
echo "b=$b"
Thanks again
Neeraj Lal
-----Original Message-----
From: Lal, Neeraj [mailto:Neeraj.Lal@Pfizer.com]
Sent: Thursday, September 12, 2002 5:42 PM
To: 'hpux-admin@dutchworks.nl'
Subject: [HPADM] Script Question
Hi Admins
I have a small question on script
In a variable let us say I store a=12345 and now I want to print or store in
another variable where that variable will always be 7 byte and it should be
stored as right justified
in an examle to illsutrate more
a=12345
it should be tranformed as b=space1space212345 (b variable will never be
more than 7 bytes)
or
a=123456
b should space1123456
or another case to explain further
a=123
so be should be space1space2spcae3space4123
Thanks
Neeraj Lal
-- ---> Please post QUESTIONS and SUMMARIES only!! <--- To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl Name: hpux-admin@dutchworks.nl Owner: owner-hpux-admin@dutchworks.nl Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin (FTP, browse only) http://www.dutchworks.nl/htbin/hpsysadmin (Web, browse & search) -- ---> Please post QUESTIONS and SUMMARIES only!! <--- To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl Name: hpux-admin@dutchworks.nl Owner: owner-hpux-admin@dutchworks.nl Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin (FTP, browse only) http://www.dutchworks.nl/htbin/hpsysadmin (Web, browse & search)
This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:19 EDT