i need to accept the user input in my c shell script before executing next command. i have the following code which ask for user input, but does not store this value.
set req
echo " Enter your input(Y/N)?"
read req
if (req = Y)
echo " print $req"
else
echo " print $req"
... (3 Replies)
Dear Friends,
I am doing a sh shell script , But I dont have any idea how to read value from user Keyboard and store them to an array .. Is it possible or not I am not also sure in sh shell script ?
EX:-
#! /bin/sh
read DATA
echo "DATA -" $DATA
echo "DATA -" $DATA
echo "DATA... (7 Replies)
Dear All,
The sqlplus 'Accept' command is not waiting for user input when I include the command within a shell script.
Note: The 'Accept' command is working fine if I execute it in a SQLPLUS Prompt.
Please fins the below sample script which i tried.
SCRIPT:
--------
#!... (4 Replies)
All,
problem Description: For example: I have two shell scripts(executables). let name it as script1 and script2.I'm trying to execute script1 from script2. while executing script2, script1 is asking for manual input(input from keyboard).
Now i need to know how I can skip this user input... (3 Replies)
I want to create an array which can store the strings from the user input in shell script .
example :-
I want to store the 5 fruits name in a single array which the user provides . (1 Reply)
i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled.
#!/bin/sh
echo " Enter your choice to continue y/Y OR n/N to quit "
read A
if
then
echo " user requested to continue "
##some commands... (7 Replies)
How to check the user input to be valid using shell script?
The valid input is in the format like as follows.
1. It can only have r,w,x or a hyphen and nothing else.
2. ensure the r, w, x are in the correct order.
for example: rwxr-xr-x is a valid format.
Thanks (5 Replies)
I want a shell script that accepts user input simultaneously when performing other tasks. Example: A shell script should echo some messages on the console and when the user presses some keys it should respond to that action.
say, when user presses the key
A - more information should be printed... (2 Replies)
I still cannot figure out how to get this read command to work. I want the script to ask questions when prompted, and the user to enter a response. Based on response it will continue or exit. I have not worked with this type of script before so I am almost clueless on what to do, and so far google... (6 Replies)
Hello, I want to start out by saying that I am fairly new to scripting and am looking for someone that can point me in the right direction.
Basically what I need is a way to run a interactive script that will prompt users with questions weather that be yes/no or a specific answer.. I want to be... (3 Replies)
Discussion started by: shoutcast
3 Replies
LEARN ABOUT PLAN9
dk
DK(3) Library Functions Manual DK(3)NAME
dk - Datakit conversations
SYNOPSIS
bind #kname /net/dk
bind #iname /net/dk
ctlfd = open(".../ctl", ORDWR);
write(ctlfd, "push dkmux", 10);
write(ctlfd, "config csc [no]restart name nvc window", n);
DESCRIPTION
A Datakit device--either k for the regular Datakit or i for the Incon--is a directory containing up to 256 directories, one per virtual
circuit, named 0 through 255, and a special file named clone. The specifier name matches the Datakit device to a physical device that its
virtual circuits are multiplexed over (see dkmux below).
Normally, the standard routines dial, hangup, listen, and announce (see dial(2)) are used to make, listen for, and control calls over any
network. The routines expect the following properties of any multiplexed network, not just Datakit.
Opening the clone file opens the ctl file of an unused virtual circuit. Reading any ctl file returns the name of the virtual circuit
directory. For example, reading #k/17/ctl will return the string 17.
Each virtual circuit directory contains the files:
ctl to control the virtual circuit: establish a connection, hang it up, etc.
data to converse with the remote end (via read and write)
listen to listen for calls (after announcing; see below)
other information about the conversation
raddr the address of the remote end
ruser the id of the user at the remote end (when applicable)
To set up and tear down virtual circuits a process writes textual commands to the ctl file:
connect addr connect to address addr. If the connection fails, the write returns an error.
hangup tear down a connected virtual circuit.
announce name announce the readiness to accept calls to name.
accept n accept the call on virtual circuit n.
reject n e reject the call on virtual circuit n with error code e. E must be a number from 0 to 7.
Once a virtual circuit is set up, a process can converse with the remote service by reading and writing the data file. Write boundaries
are preserved.
Accepting calls to name requires the following dance:
1) announce name on a virtual circuit.
2) open the listen file in that virtual circuit's directory. When a call comes in on a virtual circuit for name, the open will return
with the file descriptor open to the control file of the incoming virtual circuit.
3) accept or reject the call by writing an accept or reject command to the ctl file of the announced virtual circuit.
A dkmux module pushed onto a stream makes that stream a multiplexed connection to a Datakit. The subsequent config control message config-
ures the multiplexer and matches it to a dk device. The parameters to the config message are
csc the line number of the common signaling channel (must be > 0)
nvc the number of virtual circuits (optional; default chosen by Datakit)
[no]restart
the word restart or norestart (optional; default is restart). Restart tells the Datakit to forget all previous connections and
authentications for this machine.
name The name used in binding dk device.
window the default URP window size for virtual circuits on this Datakit line (default is 2048).
FILES
#k/clone
#k/[0-255]
#k/[0-255]/data
#k/[0-255]/ctl
#k/[0-255]/listen
#k/[0-255]/ruser
#k/[0-255]/raddr
SEE ALSO stream(3), dkconfig(8), datakit(3)SOURCE
/sys/src/9/*/devdk.c
DK(3)