Prompt User for Pgm Output Destination


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Prompt User for Pgm Output Destination
# 1  
Old 02-28-2006
Prompt User for Pgm Output Destination

SCO Open Server 5

A program that I am working with outputs data to a system or printer with the traditional output
> lp [-options] [system-printer]

This output line along with some other job output formatting information is stored as a defined output within the program so that the average user scrolls the list of defined outputs, such as, HPLaser1, and the corresponding settings and destination are handled.

I am working with a fax package for the system which, in the majestic simplicity of UNIX, works much the same as above. The output sequence is
> fax [-options] [phone-number]

again..

> fax -a -t 5551212

This is great for setting up as a standard destination within the program as long as the user always wants to select "FAX-Office2", knowing that the output always needs to go to the fax machine in office2 with the phone number 5551212.

How can I create an output sequence that would prompt the user to input the destination digits? The goal is for the user to select "OutboundFAX"... Which is already defined as a destination in the software of

> fax -a -t [prompt user for destination phone number]

System would respond:
"Please enter fax phone number"
?

After receiving input, system would proceed

> fax -a -t uservariable

Thanks,
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to prompt user to define a variable?

Hi everyone, Is it possible to define blank vaianbles and prompt user to fill them during the script execution? A very simple example: INPUT= OUTPUT= cut -f1-4 $INPUT | sed 's/hello/goodbye/g' | sort -uV > $OUTPUTThank you in advance! Best wishes (2 Replies)
Discussion started by: lsantome
2 Replies

2. Shell Programming and Scripting

User prompt for perl

perl -aF/\\t/ -lne 'BEGIN{%m=map{chomp;s/\cM|\cJ//g;$p=join("\t",(split/\t/));($p,$_)} <>;$m{"#CHROM\tINFO"}=$m{"Chr\tSegment Position"}};/SEGPOS=(\d+)/ || /\t(INFO)\t/ or next;$p=$F."\t".$1;exists $m{$p} and print join("\t",$_,$m{$p})' 12345_Marfan20_Output_Mutation_Report.txt <... (3 Replies)
Discussion started by: cmccabe
3 Replies

3. Red Hat

Command understanding the output file destination in case of standard output!!!!!

I ran the following command. cat abc.c > abc.c I got message the following message from command cat: cat: abc.c : input file is same as the output file How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies

4. UNIX for Dummies Questions & Answers

Linux user prompt

Hi, I cant seem to get this right. Lets say I have root privileges and I wanted: a ) edit the user prompt to show "linux1234$" whenever they log-in. also b ) Show a message for users upon logging in. I know a) has something to do with editing PS1. but how to only apply the change for users?... (1 Reply)
Discussion started by: Azi
1 Replies

5. Shell Programming and Scripting

Prompt user for info

Please forgive this newbie question. I have a need to create a script that asks a user for information. Something like: What is the name: $NAME_TYPED_HERE Is $NAME_TYPED_HERE Correct ? YES (NO would go back to -What is the Name-) mkdir then goes on behind the scene and makes folder called... (1 Reply)
Discussion started by: crowman
1 Replies

6. AIX

Not able to create a new user through prompt and smit

Hi, I tried to create a user through smit and command and getting the error: 3004-698 Error committing changes Please suggest. Regards, Ravi Dwivedi (1 Reply)
Discussion started by: dwiravi
1 Replies

7. UNIX for Dummies Questions & Answers

change user> to user@host> ssh prompt

Hi, I was wondering how to change the prompt for my ssh login. At the moment it is like user> while I'd like it to be as user@host> It is in the .bash_profile or .ssh ??? Thanks (2 Replies)
Discussion started by: pmasterkim
2 Replies

8. Shell Programming and Scripting

Help with a user prompt

Hi, I am attempting to write a BASH shell script that will prompt users for responses before accomplishing some tasks. Due to the top-to-bottom nature of shell scripts, asking users questions in sequence is quite easy. However, I am interested in allowing users to go back to and re-answer... (1 Reply)
Discussion started by: msb65
1 Replies

9. HP-UX

FTP user information on destination server

Could any one please tell me how to check the ftp users information on the destination server ( Hp-UX ) ? Source server used to do FTP to my server ( that is destination server ) . Now , he is getting error that login is incorrect and unable to login into destination server . Please tell me how to... (3 Replies)
Discussion started by: randhir
3 Replies

10. Programming

Pgm Output is Interleaved with other pgms

Hi I have a shared object which is called from a third party tool. In my .so, I am using 'freopen(mylogfilename,"at",stderr)'. It is logging all my program output and it is also writing warning messages from the third party daemons also. How can I avoid these unwanted messages... (1 Reply)
Discussion started by: axes
1 Replies
Login or Register to Ask a Question
lpx(8)							      System Manager's Manual							    lpx(8)

Name
       lpx - line printer exerciser

Syntax
       /usr/field/lpx [ -h ] [ -ofile ] [ -pn ] [ -tm ] -ddev

Description
       The line printer exerciser outputs a rolling character pattern to the printer. Five pages are output and then the printer will pause for 15
       minutes (default).  Then 5 more pages are output, followed by a pause.  This pattern continues until the process receives a or a  kill  -15
       pid.

       Disable	the line printer queue of the printer to be tested before running Check the file to determine the line printer queue, and then run
       line printer control program to disable the printer.  This will stop other jobs from interfering with the testing.

Arguments
       You must specify the following function flag and its argument to the exerciser:

       -ddev
	    The line printer device name and unit number to test as listed in the directory.  For example, lp, lp1.

Options
       The options are:

       -h   Prints the help messages for the command.

       -ofile
	    Saves the output diagnostics in file.

       -pn  Sets pause for n minutes.  During the pause period, will only exercise the controller, saving paper.  The default value for n  is  15.
	    A value of n = 0 indicates no pause.

       -tm  Specifies the run time in minutes (m).  The default is to run until the process receives a or kill -15 pid.

Restrictions
       If  there  is  a  need to run a system exerciser over an NFS link or on a diskless system there are some restrictions.  For exercisers that
       need to write into a file system, such as the target file system must be writable by root.  Also the directory, in which any of	the  exer-
       cisers  are  executed,  must be writable by root because temporary files are written into the current directory.  These latter restrictions
       are sometimes difficult to overcome because often NFS file systems are mounted in a way that prevents root from writing into them.  Some of
       the restrictions may be overcome by copying the exerciser to another directory and then executing it.

Examples
       The following example causes to exercise lp1 until the process receives a or kill -15 pid.
       % /usr/field/lpx -dlp1
       The following example exercises lp for 120 minutes in the background.
       % /usr/field/lpx -t120 -dlp &

See Also
       Guide to System Exercisers

																	    lpx(8)