08-09-2006
Quote:
Originally Posted by dhananjayk
i can use regular expressions to check whether entered string is numeric or character one ... but how can i restrict it to 2 or 3 digits only ?
the express is \d{2,3}
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT OPENSOLARIS
fcvt
ecvt(3C) Standard C Library Functions ecvt(3C)
NAME
ecvt, fcvt, gcvt - convert floating-point number to string
SYNOPSIS
#include <stdlib.h>
char *ecvt(double value, int ndigit, int *restrict decpt, int *restrict sign);
char *fcvt(double value, int ndigit, int *restrict decpt, int *restrict sign);
char *gcvt(double value, int ndigit, char *buf);
DESCRIPTION
The ecvt(), fcvt() and gcvt() functions convert floating-point numbers to null-terminated strings.
ecvt()
The ecvt() function converts value to a null-terminated string of ndigit digits (where ndigit is reduced to an unspecified limit determined
by the precision of a double) and returns a pointer to the string. The high-order digit is non-zero, unless the value is 0. The low-order
digit is rounded. The position of the radix character relative to the beginning of the string is stored in the integer pointed to by decpt
(negative means to the left of the returned digits). The radix character is not included in the returned string. If the sign of the result
is negative, the integer pointed to by sign is non-zero, otherwise it is 0.
If the converted value is out of range or is not representable, the contents of the returned string are unspecified.
fcvt()
The fcvt() function is identical to ecvt() except that ndigit specifies the number of digits desired after the radix point. The total num-
ber of digits in the result string is restricted to an unspecified limit as determined by the precision of a double.
gcvt()
The gcvt() function converts value to a null-terminated string (similar to that of the %g format of printf(3C)) in the array pointed to by
buf and returns buf. It produces ndigit significant digits (limited to an unspecified value determined by the precision of a double) in %f
if possible, or %e (scientific notation) otherwise. A minus sign is included in the returned string if value is less than 0. A radix
character is included in the returned string if value is not a whole number. Trailing zeros are suppressed where value is not a whole num-
ber. The radix character is determined by the current locale. If setlocale(3C) has not been called successfully, the default locale,
POSIX, is used. The default locale specifies a period (.) as the radix character. The LC_NUMERIC category determines the value of the
radix character within the current locale.
RETURN VALUES
The ecvt() and fcvt() functions return a pointer to a null-terminated string of digits.
The gcvt() function returns buf.
ERRORS
No errors are defined.
USAGE
The return values from ecvt() and fcvt() might point to thread-specific data that can be overwritten by subsequent calls to these functions
by the same thread.
For portability to implementations conforming to earlier versions of Solaris, sprintf(3C) is preferred over this function.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO
printf(3C), setlocale(3C), sprintf(3C), attributes(5), standards(5)
SunOS 5.11 18 May 2004 ecvt(3C)