06-26-2007
Um, this is input by user right ? And you want to be sure what he entered ? I guess one way would be to construct a regexp for each of conditions, something like : if $input equals [^some*mask$]; then action.
But this will require a lot of work and many conditions, as there may be more than one combination. Which language you're planning to use ?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
Hi all,
I have a shell script(K shell) which takes a date as input.
i want the input to be in DD-MM-YYYY format.
Can i enforce such a format of input string using just one line of code?
OR
do i need to parse the input date into different components and test them using Case statements... (2 Replies)
Discussion started by: rajugp1
2 Replies
3. Shell Programming and Scripting
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
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
5. Shell Programming and Scripting
Hi,
This will most likely be a simple answer.
Currently I have a situation where my script will be sent various options:
-o1 -o2 -oe3@somthing.com
Now, if I want to run a certain command based on the option I am sent, I am doing the following.
for o in $(echo $options)
do
if
... (3 Replies)
Discussion started by: stuaz
3 Replies
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
$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
9. Shell Programming and Scripting
We have a job which we need to run on daily bases, before loading data in a table we need to validate whether the input file is received or not.Inputfile formatsrc_sps_d_Call_Center_Reporting_yyyymmdd_01.dat SPS-Service nameYYYY-yearMM-MonthDD-dayLike above we will get n number of files for... (1 Reply)
Discussion started by: katakamvivek
1 Replies
10. Shell Programming and Scripting
We have a job which we need to run on daily bases, before loading data in a table we need to validate whether the input file is received or not.
Daily client will place the files in a particular path.Below files which I need to process for 04/01/2013(Load date).... (2 Replies)
Discussion started by: katakamvivek
2 Replies
LEARN ABOUT DEBIAN
tcl_deletechannelhandler
Tcl_CreateChannelHandler(3tcl) Tcl Library Procedures Tcl_CreateChannelHandler(3tcl)
__________________________________________________________________________________________________________________________________________________
NAME
Tcl_CreateChannelHandler, Tcl_DeleteChannelHandler - call a procedure when a channel becomes readable or writable
SYNOPSIS
#include <tcl.h>
void
Tcl_CreateChannelHandler(channel, mask, proc, clientData)
void
Tcl_DeleteChannelHandler(channel, proc, clientData)
ARGUMENTS
Tcl_Channel channel (in) Tcl channel such as returned by Tcl_CreateChannel.
int mask (in) Conditions under which proc should be called: OR-ed combination of TCL_READABLE, TCL_WRITABLE and
TCL_EXCEPTION. Specify a zero value to temporarily disable an existing handler.
Tcl_FileProc *proc (in) Procedure to invoke whenever the channel indicated by channel meets the conditions specified by
mask.
ClientData clientData (in) Arbitrary one-word value to pass to proc.
_________________________________________________________________
DESCRIPTION
Tcl_CreateChannelHandler arranges for proc to be called in the future whenever input or output becomes possible on the channel identified
by channel, or whenever an exceptional condition exists for channel. The conditions of interest under which proc will be invoked are speci-
fied by the mask argument. See the manual entry for fileevent for a precise description of what it means for a channel to be readable or
writable. Proc must conform to the following prototype:
typedef void Tcl_ChannelProc(
ClientData clientData,
int mask);
The clientData argument is the same as the value passed to Tcl_CreateChannelHandler when the handler was created. Typically, clientData
points to a data structure containing application-specific information about the channel. Mask is an integer mask indicating which of the
requested conditions actually exists for the channel; it will contain a subset of the bits from the mask argument to Tcl_CreateChannelHan-
dler when the handler was created.
Each channel handler is identified by a unique combination of channel, proc and clientData. There may be many handlers for a given channel
as long as they do not have the same channel, proc, and clientData. If Tcl_CreateChannelHandler is invoked when there is already a handler
for channel, proc, and clientData, then no new handler is created; instead, the mask is changed for the existing handler.
Tcl_DeleteChannelHandler deletes a channel handler identified by channel, proc and clientData; if no such handler exists, the call has no
effect.
Channel handlers are invoked via the Tcl event mechanism, so they are only useful in applications that are event-driven. Note also that
the conditions specified in the mask argument to proc may no longer exist when proc is invoked: for example, if there are two handlers for
TCL_READABLE on the same channel, the first handler could consume all of the available input so that the channel is no longer readable when
the second handler is invoked. For this reason it may be useful to use nonblocking I/O on channels for which there are event handlers.
SEE ALSO
Notifier(3tcl), Tcl_CreateChannel(3tcl), Tcl_OpenFileChannel(3tcl), vwait(3tcl).
KEYWORDS
blocking, callback, channel, events, handler, nonblocking.
Tcl 7.5 Tcl_CreateChannelHandler(3tcl)