Sponsored Content
Top Forums Shell Programming and Scripting Create a multi user input form Post 302418345 by vidhu0007 on Tuesday 4th of May 2010 02:53:35 AM
Old 05-04-2010
The form is neither a text form nor a HTML form.

It will be executed like this:

>home>dir1>dir2> ./testscript

When the user would run the above command, the form data provided will follow in the same window(same session):

ABCD TOOL


Logged User: abcd12 Current Directory: /dir1/dir2


Input1: ___________ Input2 : ________________

Input3: ___________


Confirm : Yes/No



Displaying the Header part is not a issue.

But I have no clue how to display the Input fields all at the same time and let the user enter the input one by one. Also he should be able to move from one field to other to modify it.

Till now I only used the <read> command.

Code:
echo Input1
read Input1
echo Input2
read Input2
echo Input3
read Input3

I have already mentioned the problem with the <read> command.

Please suggest some commands/ways to do it.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Multi User Multi Task

Dear Experts Why we always hear that unix operating system is Multi User and Multi task. What does these two means. I have looked at some books and documents but couldn't find aclear explenation. Can we say Windows operating system is also multi user and multi task?? Thanks for your help in... (6 Replies)
Discussion started by: Reza Nazarian
6 Replies

2. UNIX for Advanced & Expert Users

How to create short form for directories?

Hi Friends, Can you please tell me how to create short form for directories? like, this is a directory: /usr/tmp/progs/scripts when i give cd $short_name, it should take to the above path. in which env setting do i have to set? Thanks, Rashmy. (8 Replies)
Discussion started by: smr_rashmy
8 Replies

3. Shell Programming and Scripting

every time user input create array perl

Hi, How to create array every time user input and store user input and display all array print " Enter input " my @input = split(' ', $input) chmop($input = <STDIN>; foreach ($input) { @array= @input; } print @array"\n"; (1 Reply)
Discussion started by: guidely
1 Replies

4. Shell Programming and Scripting

How to automatically create variables from user input in ksh?

I need some help to write a ksh script. My code so far (pretty bad, sorry): #! /bin/ksh echo "Calculate average" UserDecision=y while test $UserDecision = y do echo "Enter a number: " read Number1 echo "Enter a number: " read Number2 echo "Do you want to enter another number?... (2 Replies)
Discussion started by: johnagar
2 Replies

5. Shell Programming and Scripting

no chance to input passwd when create new user in loop

Hi Dears, I have one script to create new users with information in one plain text file. This script will read all lines in the file and create one users for one line. Sample file: #action;login,full name title,expire date,project +;gmwen,Bruce Wen QA,04/01/2012,BT +;xxdeng,Shown Deng... (4 Replies)
Discussion started by: crest.boy
4 Replies

6. Shell Programming and Scripting

create an array which can store the strings from the user input in shell script

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)
Discussion started by: Pkast
1 Replies

7. UNIX for Dummies Questions & Answers

Input form to update configuration files

Hi I'd like to know in which direction I should go for this. Background: We have a Raspberry PI terminal which connects via XTerm to a telnet session. Openbox is the window manager(default). We have stripped down most of the unwanted apps that come with Rasparian except for browser which we... (2 Replies)
Discussion started by: majikins
2 Replies

8. Shell Programming and Scripting

Bash to search file based off user input then create new file

In the below bash a file is downloaded when the program is opened and then that file is searched based on user input and the result is written to a new file. For example, the bash is opened and the download.txt is downloaded, the user then enters the id (NA04520). The id is used to search... (5 Replies)
Discussion started by: cmccabe
5 Replies

9. Shell Programming and Scripting

Automaticaly create function based off user input

I am trying to create a bash script that will create new function by using the user input. The below will create the necessary files in the correct format, however when it comes to the # create function I am at a loss. If the name entered was NEWNAME and the genes were GENE1,GENE2 then two files... (0 Replies)
Discussion started by: cmccabe
0 Replies
CGI::FormBuilder::Template::CGI_SSI(3pm)		User Contributed Perl Documentation		  CGI::FormBuilder::Template::CGI_SSI(3pm)

NAME
CGI::FormBuilder::Template::CGI_SSI - FormBuilder interface to CGI::SSI SYNOPSIS
my $form = CGI::FormBuilder->new( fields => @fields, template => { type => 'CGI_SSI', file => "template.html", }, ); DESCRIPTION
This engine adapts FormBuilder to use "CGI::SSI". You can specify any options which "CGI::SSI->new" accepts by using a hashref: my $form = CGI::FormBuilder->new( fields => @fields, template => { type => 'CGI::SSI', file => 'form.shtml', sizefmt => 'abbrev' } ); In addition to CGI::SSI new arguments, you can also specify "file", "virtual", or "string" argument. The following methods are provided (usually only used internally): engine Returns a reference to the "CGI::SSI" object prepare Returns a hash of all the fields ready to be rendered. render Uses the prepared hash and expands the template, returning a string of HTML. TEMPLATES
In your template, each of the form fields will correspond directly to a "<!--#echo -->" of the same name prefixed with "field-" in the template. So, if you defined a field called "email", then you would setup a variable called "<!--#echo var="field-email" -->" in your template. In addition, there are a couple special fields: <!--#echo var="js-head" --> - JavaScript to stick in <head> <!--#echo var="form-title" --> - The <title> of the HTML form <!--#echo var="form-start" --> - Opening <form> tag and internal fields <!--#echo var="form-submit" --> - The submit button(s) <!--#echo var="form-reset" --> - The reset button <!--#echo var="form-end" --> - Just the closing </form> tag Let's look at an example "form.html" template we could use: <html> <head> <title>User Information</title> <!--#echo var="js-head" --><!-- this holds the JavaScript code --> </head> <!--#echo var="form-start" --><!-- this holds the initial form tag --> <h3>User Information</h3> Please fill out the following information: <!-- each of these <!--#echo -->'s corresponds to a field --> <p>Your full name: <!--#echo var="field-name" --> <p>Your email address: <!--#echo var="field-email" --> <p>Choose a password: <!--#echo var="field-password" --> <p>Please confirm it: <!--#echo var="field-confirm_password--> <p>Your home zipcode: <!--#echo var="field-zipcode --> <p> <!--#echo var="form-submit" --><!-- this holds the form submit button --> </form><!-- can also use "tmpl_var form-end", same thing --> As you see, you get a "<!--#echo -->" for each for field you define. However, you may want even more control. That is, maybe you want to specify every nitty-gritty detail of your input fields, and just want this module to take care of the statefulness of the values. This is no problem, since this module also provides several other "<tmpl_var>" tags as well: <!--#echo var="value-[field] --> - The value of a given field <!--#echo var="label-[field] --> - The human-readable label <!--#echo var="comment-[field] --> - Any optional comment <!--#echo var="error-[field] --> - Error text if validation fails <!--#echo var="required-[field] --> - See if the field is required This means you could say something like this in your template: <!--#echo var="label-email" -->: <input type="text" name="email" value="<!--#echo var="value-email" -->"> <font size="-1"><i><!--#echo var="error-email" --></i></font> And FormBuilder would take care of the value stickiness for you, while you have control over the specifics of the "<input>" tag. A sample expansion may create HTML like the following: Email: <input type="text" name="email" value="nate@wiger.org"> <font size="-1"><i>You must enter a valid value</i></font> Note, though, that this will only get the first value in the case of a multi-value parameter (for example, a multi-select list). Multiple values (loops) in "CGI_SSI" are not yet implemented. For more information on templates, see HTML::Template. SEE ALSO
CGI::FormBuilder, CGI::FormBuilder::Template, HTML::Template REVISION
$Id: HTML.pm 97 2007-02-06 17:10:39Z nwiger $ AUTHOR
Copyright (c) Nate Wiger <http://nateware.com>. All Rights Reserved. This module is free software; you may copy this under the terms of the GNU General Public License, or the Artistic License, copies of which should have accompanied your Perl kit. perl v5.14.2 2011-09-16 CGI::FormBuilder::Template::CGI_SSI(3pm)
All times are GMT -4. The time now is 11:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy