Sponsored Content
Top Forums UNIX for Dummies Questions & Answers hit 'enter' with no user intervention Post 7621 by jpprial on Friday 28th of September 2001 10:52:16 AM
Old 09-28-2001
Question hit 'enter' with no user intervention

I'd like to write a shell script that will enter '1', for example. How
do you do that?
You know, so instead of writing

echo "Enter 1 or 2"
read onetwo

and waiting for the user to enter a 1 or 2,
I'd like the script to act like someone entered a 1, or 2. Is there a
hex value for the return key or something?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to subtract 2 hours from 'date' in shell ( /bin/sh ) script ?

I write a sh script that zip and copy to tape all files that older then 2 hours. 1. The way I choose is - touch a file with "now - 2 hours", then use fine with '! -newer' 2. Do you have any other idea to do it ? tnx. (1 Reply)
Discussion started by: yairon
1 Replies

2. Programming

i can't use 'make' in my computer?

I need to compile a file,but 'make' does not work.please tell me how to use it or need which tools? (3 Replies)
Discussion started by: dsun5
3 Replies

3. Shell Programming and Scripting

Clearify what it means under 'WHAT' when hit the 'w'-command

I wonder how I shall read the result below, especially 'what' shown below. The result was shown when I entered 'w'. E.g what is TOP? What is gosh ( what does selmgr mean?)? login@ idle JCPU PCPU what 6:15am 7:04 39 39 TOP 6:34am 6:45 45 45 TOP 6:41am ... (1 Reply)
Discussion started by: Aelgen
1 Replies

4. UNIX for Advanced & Expert Users

Terminal 'Local Echo' lost on Modem Dial-out

Can anybody help me? I am developing a utility for automating message paging to a BT alphanumeric pager. I am using a USR 56K Fax-modem connected to /dev/cuab on a Sun Ultra-10. I am using the UNIX 'tip' utility to connect to the modem and I have configured the modem as follows: Baud Rate:... (2 Replies)
Discussion started by: mybeat
2 Replies

5. Filesystems, Disks and Memory

HELP! The '/var/adm/message' file increase every few seconds???

Hi, guys, I have a big problem. I've got a sun solaris 4.1.4 workstation, and the /var/adm/message file will add one row every few seconds. It soon becomes a large file. I wander if there are some mistakes configuring the workstation. the /var/adm/message is as follow: ... (1 Reply)
Discussion started by: cloudsmell
1 Replies

6. UNIX for Dummies Questions & Answers

HELP! The '/var/adm/message' file increase every few seconds???

Hi, guys, I have a big problem. I've got a sun solaris 4.1.4 workstation, and the /var/adm/message file will add one row every few seconds. It becomes a large file in a short time. I wander if there are some mistakes configuring the workstation. the /var/adm/message is as follow: ... (3 Replies)
Discussion started by: cloudsmell
3 Replies

7. UNIX for Dummies Questions & Answers

quoting echo 'it's friday'

echo 'it's friday' why appear the > (3 Replies)
Discussion started by: yls177
3 Replies

8. Email Antispam Techniques and Email Filtering

Procmail recipe: blocking 'unsubscribe and opt-out' messages....

Here is a crude procmail recipe that I quickly created (NOT a procmail recipe expert, btw) that has been catching lots of spam (current second after the charset_spam recipe posted earlier): :0B * .*If.you.do.not.wish.to.receive...* more_spam :0B * You.requested.to.receive.this.mailing... (0 Replies)
Discussion started by: Neo
0 Replies

9. UNIX for Advanced & Expert Users

How to remove a file with a leading dash '-' in it's name?

Somehow someone created a file named '-ov' in the root directory. Given the name, the how was probably the result of some cpio command they bozo'ed. I've tried a number of different ways to get rid of it using * and ? wildcards, '\' escape patterns etc.. They all fail with " illegal option --... (3 Replies)
Discussion started by: GSalisbury
3 Replies

10. Shell Programming and Scripting

What are the differences between 'bash' and 'sh'

Hopefully this doesn't come off as too much of a "newbie" question or a flamebait. But I have recently begun working with a Sun Solaris box after having spent the past five years working with RedHat. From what i can tell, thing look fairly similar and the 'man' command is some help. But I've... (7 Replies)
Discussion started by: deckard
7 Replies
PTKSH(1p)						       perl/Tk Documentation							 PTKSH(1p)

NAME
ptksh - Perl/Tk script to provide a graphical user interface for testing Perl/Tk commands and scripts. SYNOPSIS
% ptksh ?scriptfile? ... version information ... ptksh> $b=$mw->Button(-text=>'Hi',-command=>sub{print 'Hi'}) ptksh> $b->pack ptksh> o $b ... list of options ... ptksh> help ... help information ... ptksh> exit % DESCRIPTION
ptksh is a perl/Tk shell to enter perl commands interactively. When one starts ptksh a MainWindow is automaticly created, along with a ptksh command window. One can access the main window by typing commands using the variable $mw at the 'ptksh> ' prompt of the command window. ptksh supports command line editing and history. Just type "<Up>" at the command prompt to see a history list. The last 50 commands entered are saved, then reloaded into history list the next time you start ptksh. ptksh supports some convenient commands for inspecting Tk widgets. See below. To exit ptksh use: "exit". ptksh is *not* a full symbolic debugger. To debug perl/Tk programs at a low level use the more powerful perl debugger. (Just enter ``O tk'' on debuggers command line to start the Tk eventloop.) FEATURES
History Press <Up> (the Up Arrow) in the perlwish window to obtain a gui-based history list. Press <Enter> on any history line to enter it into the perlwish window. Then hit return. So, for example, repeat last command is <Up><Enter><Enter>. You can quit the history window with <Escape>. NOTE: history is only saved if exit is "graceful" (i.e. by the "exit" command from the console or by quitting all main windows--NOT by interrupt). Debugging Support ptksh provides some convenience function to make browsing in perl/Tk widget easier: ?, or h displays a short help summary. d, or x ?args, ...? Dumps recursively arguments to stdout. (see Data::Dumper). You must have <Data::Dumper> installed to support this feature. x was introduced for perl debugger compatibility. p ?arg, ...? appends "| " to each of it's arguments and prints it. If value is undef, '(undef)' is printed to stdout. o $widget ?-option ...? prints the option(s) of $widget one on each line. If no options are given all options of the widget are listed. See Tk::options for more details on the format and contents of the returned list. o $widget /regexp/ Lists options of $widget matching the regular expression regexp. u ?class? If no argument is given it lists the modules loaded by the commands you executed or since the last time you called "u". If argument is the empty string lists all modules that are loaded by ptksh. If argument is a string, ``text'' it tries to do a ``use Tk::Text;''. Packages Ptksh compiles into package Tk::ptksh. Your code is eval'ed into package main. The coolness of this is that your eval code should not interfere with ptksh itself. Multiline Commands ptksh will accept multiline commands. Simply put a "" character immediately before the newline, and ptksh will continue your command onto the next line. Source File Support If you have a perl/Tk script that you want to do debugging on, try running the command ptksh> do 'myscript'; -- or (at shell command prompt) -- % ptksh myscript Then use the perl/Tk commands to try out different operations on your script. ENVIRONMENT
Looks for your .ptksh_history in the directory specified by the $HOME environment variable ($HOMEPATH on Win32 systems). FILES
.ptksh_init If found in current directory it is read in an evaluated after the mainwindow $mw is created. .ptksh_init can contain any valid perl code. ~/.ptksh_history Contains the last 50 lines entered in ptksh session(s). PITFALLS
It is best not to use "my" in the commands you type into ptksh. For example "my $v" will make $v local just to the command or commands entered until <Return> is pressed. For a related reason, there are no file-scopy "my" variables in the ptksh code itself (else the user might trounce on them by accident). BUGS
Tk::MainLoop function interactively entered or sourced in a init or script file will block ptksh. SEE ALSO
Tk perldebug VERSION
VERSION 2.03 AUTHORS
Mike Beller <beller@penvision.com>, Achim Bohnet <ach@mpe.mpg.de> Copyright (c) 1996 - 1998 Achim Bohnet and Mike Beller. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Tk804.03 2010-05-29 PTKSH(1p)
All times are GMT -4. The time now is 10:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy