Sponsored Content
Top Forums Shell Programming and Scripting restricting user input as required Post 302084099 by vino on Wednesday 9th of August 2006 06:20:39 AM
Old 08-09-2006
From man sh

Code:
       read [-ers] [-u fd] [-t timeout] [-a aname] [-p prompt] [-n nchars] [-d
       delim] [name ...]
              -n nchars
                     read returns after reading nchars characters rather  than
                     waiting for a complete line of input.

I couldnt find anything similiar for ksh. Hmm...

Or a more generalized way would be to see what this post holds - making a .sh wait for user input
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Restricting the user *LINUX RED HAT*

Hats of to all the members for providing the detailed guidence to the newbe !! :o I am working on Red Hat LINUX plateform, where the number of users are more that 50. The problem I m facing is that all the user are opening the virtual terminals and leave it unattended for hours together and... (4 Replies)
Discussion started by: vakharia Mahesh
4 Replies

2. UNIX for Advanced & Expert Users

password required when using input redirection

Hello, I need to change user and run some commands by using a script. lets say, I'm using su - someuser << start password required -----> how can I enter the password here command 1 command 2 command 3 command 4 start While trying to run this I got the following message: "standard... (2 Replies)
Discussion started by: Alalush
2 Replies

3. Shell Programming and Scripting

Input required for telnet in script

Guru, I am trying to use telnet in unix script. And it's asking password after executing telnet command in script. But I don't want to have manual intervention over there. So is it possible to pass password for telnet from script itself. What I am doing right now is something like this. ... (4 Replies)
Discussion started by: gander_ss
4 Replies

4. UNIX for Dummies Questions & Answers

Restricting a user to their home directory and below

I found this old closed thread: I can do these things, but how to I change someone's profile - where do I find the profile? I'm running Centos 5.6 ~~~~~~~~~ providing you have the password shell set to ksh, you can put this in his .profile: cd /opt/load alias -x cd=: (6 Replies)
Discussion started by: jjj0923
6 Replies

5. AIX

restricting sftp and ssh for a user

I want to know if there is any way to set up a users home directory access with a restricted shell and allow them to SFTP to the directory. I want to allow the user to SSH into their home directory but no where else on the AIX server. I also want the user to be able to SFTP files to their home... (1 Reply)
Discussion started by: daveisme
1 Replies

6. UNIX for Dummies Questions & Answers

Restricting Usage of Setuid Programs to the Admin User In MacOsx

This is a quote from the Apple security configuration (you can download it from Apple) " Using ACLs to Restrict Usage of Setuid Programs The ACL feature of Mac OS X can also be used to restrict the execution of setuid programs. Restricting the execution of setuid programs to administrators... (3 Replies)
Discussion started by: Vera
3 Replies

7. Shell Programming and Scripting

How to get the user input recursively until the user provides valid input

Hi, echo "Enter file name of input file list along with absolute path : " read inputFileList if then for string in `cat inputFileList` do echo $string done else echo " file does not exist" fi From the above code, if the user enters a invalid file... (1 Reply)
Discussion started by: i.srini89
1 Replies

8. UNIX for Dummies Questions & Answers

Create a file with input values required

Hi Guys Please can you help me to create a file using the following inputs 2351 first input 2339 second input all this rows need to have the value 0 in front 2338 third input 2333 fourth input all this rows need to have the value 1 in front count all the rows in the file and insert the... (10 Replies)
Discussion started by: jiam912
10 Replies

9. Post Here to Contact Site Administrators and Moderators

Moderator input required please

We have been told to use this method for contacting moderators (rather than PM). Can any moderator please checkout what member 'buyvpn' is up to. Thanks. ---------- Post updated at 11:19 AM ---------- Previous update was at 11:15 AM ---------- Advertising services on at least one post. (1 Reply)
Discussion started by: hicksd8
1 Replies

10. UNIX for Dummies Questions & Answers

Best Alternative for checking input parameter contains required value or not

Any good way to check if code has the required output # /sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts net.ipv4.icmp_echo_ignore_broadcasts = 1 /sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts | grep "= 1" net.ipv4.icmp_echo_ignore_broadcasts = 1 What I can think of is above, and it... (16 Replies)
Discussion started by: alvinoo
16 Replies
XTextExtents(3X11)						  XLIB FUNCTIONS						XTextExtents(3X11)

NAME
XTextExtents, XTextExtents16, XQueryTextExtents, XQueryTextExtents16 - compute or query text extents SYNTAX
XTextExtents(font_struct, string, nchars, direction_return, font_ascent_return, font_descent_return, overall_return) XFontStruct *font_struct; char *string; int nchars; int *direction_return; int *font_ascent_return, *font_descent_return; XCharStruct *overall_return; XTextExtents16(font_struct, string, nchars, direction_return, font_ascent_return, font_descent_return, overall_return) XFontStruct *font_struct; XChar2b *string; int nchars; int *direction_return; int *font_ascent_return, *font_descent_return; XCharStruct *overall_return; XQueryTextExtents(display, font_ID, string, nchars, direction_return, font_ascent_return, font_descent_return, overall_return) Display *display; XID font_ID; char *string; int nchars; int *direction_return; int *font_ascent_return, *font_descent_return; XCharStruct *overall_return; XQueryTextExtents16(display, font_ID, string, nchars, direction_return, font_ascent_return, font_descent_return, overall_return) Display *display; XID font_ID; XChar2b *string; int nchars; int *direction_return; int *font_ascent_return, *font_descent_return; XCharStruct *overall_return; ARGUMENTS
direction_return Returns the value of the direction hint (FontLeftToRight or FontRightToLeft). display Specifies the connection to the X server. font_ID Specifies either the font ID or the GContext ID that contains the font. font_ascent_return Returns the font ascent. font_descent_return Returns the font descent. font_struct Specifies the XFontStruct structure. nchars Specifies the number of characters in the character string. string Specifies the character string. overall_return Returns the overall size in the specified XCharStruct structure. DESCRIPTION
The XTextExtents and XTextExtents16 functions perform the size computation locally and, thereby, avoid the round-trip overhead of XQuery- TextExtents and XQueryTextExtents16. Both functions return an XCharStruct structure, whose members are set to the values as follows. The ascent member is set to the maximum of the ascent metrics of all characters in the string. The descent member is set to the maximum of the descent metrics. The width member is set to the sum of the character-width metrics of all characters in the string. For each charac- ter in the string, let W be the sum of the character-width metrics of all characters preceding it in the string. Let L be the left-side- bearing metric of the character plus W. Let R be the right-side-bearing metric of the character plus W. The lbearing member is set to the minimum L of all characters in the string. The rbearing member is set to the maximum R. For fonts defined with linear indexing rather than 2-byte matrix indexing, each XChar2b structure is interpreted as a 16-bit number with byte1 as the most significant byte. If the font has no defined default character, undefined characters in the string are taken to have all zero metrics. The XQueryTextExtents and XQueryTextExtents16 functions return the bounding box of the specified 8-bit and 16-bit character string in the specified font or the font contained in the specified GC. These functions query the X server and, therefore, suffer the round-trip over- head that is avoided by XTextExtents and XTextExtents16. Both functions return a XCharStruct structure, whose members are set to the val- ues as follows. The ascent member is set to the maximum of the ascent metrics of all characters in the string. The descent member is set to the maximum of the descent metrics. The width member is set to the sum of the character-width metrics of all characters in the string. For each charac- ter in the string, let W be the sum of the character-width metrics of all characters preceding it in the string. Let L be the left-side- bearing metric of the character plus W. Let R be the right-side-bearing metric of the character plus W. The lbearing member is set to the minimum L of all characters in the string. The rbearing member is set to the maximum R. For fonts defined with linear indexing rather than 2-byte matrix indexing, each XChar2b structure is interpreted as a 16-bit number with byte1 as the most significant byte. If the font has no defined default character, undefined characters in the string are taken to have all zero metrics. Characters with all zero metrics are ignored. If the font has no defined default_char, the undefined characters in the string are also ignored. XQueryTextExtents and XQueryTextExtents16 can generate BadFont and BadGC errors. DIAGNOSTICS
BadFont A value for a Font or GContext argument does not name a defined Font. BadGC A value for a GContext argument does not name a defined GContext. SEE ALSO
XLoadFont(3X11), XTextWidth(3X11) Xlib - C Language X Interface X Version 11 Release 6.6 XTextExtents(3X11)
All times are GMT -4. The time now is 06:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy