Search Results

Search: Posts Made By: pyscho
1,332
Posted By pyscho
Improving this validate function
Hi guys, I use this function which was provided to me by someone at this site. It works perfectly for validating a users input option against allowed options..

example:

validateInput "1" "1 3...
6,576
Posted By pyscho
Thanks Scott that worked. The line number it was...
Thanks Scott that worked. The line number it was erroring at was the last line in the file for some reason.
6,576
Posted By pyscho
Thanks Scott. I have a further problem now. ...
Thanks Scott. I have a further problem now.


# Validate users input when they start/stop daemons
function validateInput {
input = "${$1}"
allowedInput = "${2}"

for...
6,576
Posted By pyscho
Its still not working :( function...
Its still not working :(


function print_daemon_options {
echo "Start Daemons - Please enter one or a combination of the following:"

if isDatasubEnabled && isReconEnabled; then
...
6,576
Posted By pyscho
I made the change and I still get an error (and...
I made the change and I still get an error (and also, yep isDatasubEnabled and isReconEnabled are functions within the same script)


function print_daemon_options {
echo "Start Daemons -...
6,576
Posted By pyscho
Thanks for the reply Scott. I've got a function...
Thanks for the reply Scott. I've got a function like this


function print_daemon_options {
echo "Start Daemons - Please enter one or a combination of the following:"

if...
6,576
Posted By pyscho
How to return a string?
function blah {
return "string"
}


it keeps saying string: not found

How can i do this guys? Because I'm trying to do something like this


function print_daemon_options {
echo "Start...
7,123
Posted By pyscho
Thanks alot for this felipe - it looks like it is...
Thanks alot for this felipe - it looks like it is exactly what I need. I will combine this function with my stuff and post back!
7,123
Posted By pyscho
Many thanks for the reply felipe. But is there a...
Many thanks for the reply felipe. But is there a way to set the validation when the options are echo'd, for example:

if isDatasubEnabled && isReconEnabled; then
echo "1 = CGT, 2 =...
7,123
Posted By pyscho
Command line user input validation
Hi guys, I have a piece of snippet below which asks the user to input some numbers


if isDatasubEnabled && isReconEnabled; then
echo "1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 =...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 01:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy