12-14-2001
Reading input to create a variable in a script?
---------------------
If you will use REPLY. (Give read no variable)
echo "What is your name ?" ; read
echo $REPLY #use big letters
---------------------
If you will use a variable
echo "What is your name ?" ; read TheNameIs
echo $TheNameIs
---------------------
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
#!/usr/bin/sh
echo "Enter reason:"
echo "> \c"
read $reason
$reason >> access.log
This doesnt work for me. Can someone tell me how I would read the input from what the person types, and then append that to the log file?
Regards (2 Replies)
Discussion started by: alwayslearningunix
2 Replies
2. Shell Programming and Scripting
#!/bin/sh
rpt="/export/home/legato/rpt_offsite"/test_eject.tape
cat <$rpt
while read line
do
echo $line
perform routine
done
I am trying to read the contents of this file line by line and perform a routine for each line read.
The file contents are numbers..
What is wrong with my... (1 Reply)
Discussion started by: gzs553
1 Replies
3. Shell Programming and Scripting
Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .
Hi I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.
I want to create a mutiple output files with each file having a... (2 Replies)
Discussion started by: bhargavkr
2 Replies
4. Shell Programming and Scripting
Hello.
I've written up a script, that populates a variable with a list of tapes returned from my library. For example:
701940L3,701941L3,701942L3,701943L3,701944L3,701945L3,701946L3,701947L3,701948L3
So now, the variable "TAPELIST" contains those numbers, delimited by commas. I'd like to... (6 Replies)
Discussion started by: Stephan
6 Replies
5. Shell Programming and Scripting
I need to know how the the string constant from Input File should be read and provide as input data for the script .
INPUT FILE
CONST VARIABLE
myname=/root/dir/syslog/myname1
myname=/root/dir/syslog/myname2
myname=/root/dir/syslog/myname3
urname=/root/dir/syslog/urname1... (6 Replies)
Discussion started by: baraghun
6 Replies
6. Shell Programming and Scripting
Can I do something like,
if($0==/^int.*$/) {
print "Declaration"
}
for an input like: int a=5;
If the syntax is right, it is not working for me, but I am not sure about the syntax. Please help.
Thanks,
Prasanna (1 Reply)
Discussion started by: prasanna1157
1 Replies
7. Shell Programming and Scripting
Alright, so the goal of my script is to read text from standard input and store it into a file using the ex-editor:
so far i've got this, but it doesn't work.
#!/bin/s
read text
ex $1 >> HERE
text
HERE
I don't get any errors either, so i don't know what i'm doing wrong. (7 Replies)
Discussion started by: Bertieboy7
7 Replies
8. Shell Programming and Scripting
This is one of the strangest things that's happening to me.
I'm writing a new Perl script that is trying to read a file.
The file is originally in .mof format, but I also saved the contents into a .txt file.
As a simple test, I wrote this:
#!/user/bin/perl -w
use strict;
... (3 Replies)
Discussion started by: kooshi
3 Replies
9. Shell Programming and Scripting
I am currently trying to develop a script to connect to mulltiple servers, reading specifc data from log files on the servers and append the data from each file into a single tab delimited row. So, at the end I am planning to have a report with all the extracted data with each row per server. I am... (5 Replies)
Discussion started by: scriptingnewbie
5 Replies
10. Shell Programming and Scripting
I've always written scripts where the user executes the script and I prompt them for what they want to do.
But I'm trying to write a script where root executes the script 'lock' or its hard-link 'unlock' and the script will passwd -l or passwd -u an account depending on the choice.
What would... (3 Replies)
Discussion started by: ADay2Long
3 Replies
LEARN ABOUT OPENSOLARIS
echo
echo(3XCURSES) X/Open Curses Library Functions echo(3XCURSES)
NAME
echo, noecho - enable/disable terminal echo
SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib
-R /usr/xpg4/lib -lcurses [ library... ]
c89 [ flag... ] file... -lcurses [ library... ]
#include <curses.h>
int echo(void);
int noecho(void);
DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially,
curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft-
ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined.
RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR.
ERRORS
No errors are defined.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5)
SunOS 5.11 5 Jun 2002 echo(3XCURSES)