Sponsored Content
Top Forums Shell Programming and Scripting Is there a simpler way to validate user input for float? Post 302488507 by kshji on Monday 17th of January 2011 12:34:51 PM
Old 01-17-2011
ksh93
Code:
typeset -F2 price
price=100
echo $price

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

validate input from user for file name

Hello, This may have been addressed already somewhere, however I am looking for the easiest/shortest way to validate a response from a user for a file name. The file name should not have any of the following characters ~`!@#$%^&*()_-+={|\:;"'<,>.?/ Further the response should not have any... (2 Replies)
Discussion started by: jerardfjay
2 Replies

2. Shell Programming and Scripting

How to validate input values

Hi How would i validate value of a variable whether it is number,date or string Thanks in advance Sas (5 Replies)
Discussion started by: SasDutta
5 Replies

3. Shell Programming and Scripting

validate input

the user inputs names that have to be inside square brackets I want to check if the user puts the brackets and if not ask him to re-enter the names (9 Replies)
Discussion started by: DDoS
9 Replies

4. UNIX for Dummies Questions & Answers

input a float data and add them in shell in linux

I want to input a float data and add them in shell in linux. I am new user of it can anyone tell me how I can do it? thanx (5 Replies)
Discussion started by: purva
5 Replies

5. Shell Programming and Scripting

float input

how to input float data type in bash shell programming in linux? I am new to it so unaware to use the commands plz help me out. thank you. (6 Replies)
Discussion started by: purva
6 Replies

6. UNIX for Dummies Questions & Answers

BASH validate user input

Hey, im trying to validate a user input and need some help. The input needs to be just a single letter. Im using a case to so this eg: read answer case $answer in *) echo "OK" ;; *) echo "This is a number" read answer ;; *) echo... (2 Replies)
Discussion started by: 602chrislys
2 Replies

7. Shell Programming and Scripting

How to validate input parameters?

Hi, I wonder how I can know if the input parameters to the script are numbers or text Thanks (11 Replies)
Discussion started by: Gengis-Kahn
11 Replies

8. Shell Programming and Scripting

Another validate input Question.

I'm writing a bash shell script to 'help' me post to susepaste (I can NEVER remember the time options). Here's the code: #!/bin/bash ########## # # Project : personal script. # Started : Wed Aug 03, 2011 # Author : Habitual # Description : susepaste c-li script with user... (5 Replies)
Discussion started by: Habitual
5 Replies

9. Shell Programming and Scripting

[bash] how is proper way to validate user input

hi all, i have a script that need user input provide all variables that needed to complete a job. this is my current script: echo "type file source and it full path :" read INPUTFILE if || ; then echo "ERROR: you didn't enter a file source or file source is not... (2 Replies)
Discussion started by: makan
2 Replies

10. Shell Programming and Scripting

How to validate user's input..?

$Input_filename=$ARGV; if (!-d $Input_filename && ! -e $Input_filename) { print "USAGE: Please enter '$ABCD/def/dsed.txt' as an arguement \n"; exit; } 1. Input Is suppose to be something like "$ABCD/def/dsed.txt". if the input is wrong the script should throw an ERROR message.... (2 Replies)
Discussion started by: Rashid Khan
2 Replies
PAC(8)							    BSD System Manager's Manual 						    PAC(8)

NAME
pac -- printer/plotter accounting information SYNOPSIS
pac [-cmrs] [-P printer] [-p price] [name ...] DESCRIPTION
pac reads the printer/plotter accounting files, accumulating the number of pages (the usual case) or feet (for raster devices) of paper con- sumed by each user, and printing out how much each user consumed in pages or feet and dollars. Options and operands available: -Pprinter Accounting is done for the named printer. Normally, accounting is done for the default printer (site dependent) or the value of the environment variable PRINTER is used. -c flag causes the output to be sorted by cost; usually the output is sorted alphabetically by name. -m flag causes the host name to be ignored in the accounting file. This allows for a user on multiple machines to have all of his printing charges grouped together. -pprice The value price is used for the cost in dollars instead of the default value of 0.02 or the price specified in /etc/printcap. -r Reverse the sorting order. -s Accounting information is summarized on the summary accounting file; this summarization is necessary since on a busy system, the accounting file can grow by several lines per day. names Statistics are only printed for user(s) name; usually, statistics are printed for every user who has used any paper. OUTPUT FORMAT
pac formats the output into simple table, using four columns - number of feets or pages (column "pages/feet"), how many copies were made (column "runs"), total price for this print (column "price") and user login with host name (column "login" or "host name and login"). If argument name was not used and hence pac is printing information for all users, a summary line with print totals (runs, pages, price) is appended. Note that pac on other system might print the price as price per copy. FILES
/var/account/?acct raw accounting files /var/account/?_sum summary accounting files /etc/printcap printer capability data base SEE ALSO
printcap(5) HISTORY
The pac command appeared in 4.0BSD. BUGS
The relationship between the computed price and reality is as yet unknown. BSD
June 6, 1993 BSD
All times are GMT -4. The time now is 06:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy