![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to enter if-then condition on command prompt/line ? | mpc8250 | Shell Programming and Scripting | 3 | 02-10-2008 12:27 PM |
| writing Enter key inside in shell script | bishweshwar | Shell Programming and Scripting | 3 | 01-04-2008 12:45 PM |
| using enter key in shell script | bishweshwar | UNIX for Advanced & Expert Users | 1 | 06-06-2007 11:24 PM |
| KSH Script/FTP (NEWBIE) | mike509123 | Shell Programming and Scripting | 2 | 01-19-2006 02:14 PM |
| possible to run script to enter info within a program? | lianderthal | Shell Programming and Scripting | 1 | 06-09-2005 07:40 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi,
I have the following script which calls a program that asks for user input before progressing. I am new to scripting and this script was written by the previous admin. After $MERGE is executed the application associated with it needs user input - asks for 'Enter' to be pressed. At the moment the output is being redirected to /dev/null. I need to know how to script this. I have seen in other threads that you place a \r (carriage return) into the script. I don't know exactly how to do this though. Thanks for your help. MERGE="/opt/application/application $MERGE @list merged.pdf > /dev/null 2>&1 if (( $? != 0 )) then print "Merging files $patid_prev failed." >> $LOGFILE else patno=`echo $patid_prev | awk '{printf("%06d",$1)}'` mv merged.pdf "$STARCH_DIR/${studyno}-${patno}.pdf" fi $MERGE > /dev/null 2>&1 if (( $? != 0 )) then print "PDF-Meld is not installed or not accessible." >> $LOGFILE print "" >> $LOGFILE print "Program aborted." >> $LOGFILE rm -rf $WORKDIR exit 1 fi |
|
||||
|
If the app takes "yes" or enter you could check if you can use "/usr/bin/yes". Example: Code:
doThis() { echo "Delete this continent?"; read ans; echo $ans; }
]$ yes | doThis
If it doesn't work then 'echo "\n"' is a newline, also see 'man echo'. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|