- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Is it possible to provide limits when reading a va...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 03:37 AM
04-28-2003 03:37 AM
Is it possible to provide limits when reading a variable on a script
read NOTES ## Notes for table field.
But we also want to set a limit to the number of characters the user can type (let's say 40 max). Is there a way to do this with scripting?
Also, is there a way to set an underline, special character delimiters, or something like a background highlight to show the user on the shell his/her limits for typing?
Thanks for any ideas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 03:40 AM
04-28-2003 03:40 AM
Re: Is it possible to provide limits when reading a variable on a script
look at man page and typeset option
|| typeset [+LRZfilrtux[n]] [name[ = value]] ...
Parameter assignments remain in effect after the
command completes. When invoked inside a function, a
new instance of the parameter name is created. The
parameter value and type are restored when the function
completes. The following list of attributes can be
specified:
-L Left justify and remove leading blanks from
value. If n is non-zero, it defines the
width of the field. Otherwise, it is
determined by the width of the value of first
assignment. When the name is assigned, the
value is filled on the right with blanks or
truncated, if necessary, to fit into the
field. Leading zeros are removed if the -Z
option is also set. The -R option is turned
off.
-R Right justify and fill with leading blanks.
If n is non-zero, it defines the width of the
field. Otherwise, it is determined by the
width of the value of first assignment. The
field is left-filled with blanks or truncated
from the end if the parameter is reassigned.
:
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 04:12 AM
04-28-2003 04:12 AM
Re: Is it possible to provide limits when reading a variable on a script
try Jean-Louis Phelix' excellent answer in this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x3b7b402f24d5d61190050090279cd0f9,00.html
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 04:35 AM
04-28-2003 04:35 AM
Re: Is it possible to provide limits when reading a variable on a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 04:42 AM
04-28-2003 04:42 AM
Re: Is it possible to provide limits when reading a variable on a script
'typeset' is a shell built-in. See the man pages for 'sh-posix' for information on it.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 05:24 AM
04-28-2003 05:24 AM
Re: Is it possible to provide limits when reading a variable on a script
typeset is in the ksh
steve Steel