Script to automation utility app


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to automation utility app
# 1  
Old 04-22-2014
Script to automation utility app

Hi All,

Am trying to write a shell script to automate one of the product utility but am struck with how to send/key in the inputs and most importantly it requires to press "Enter" key every time after giving the input.

Not sure how to take control of utility from script and key in values/command.

Can anyone please suggest or show the example on how automate the utility thru shell script.

ex: how utility is work manually.

./testItem

it opens screen with key in the input/command

once input is typed/key in then we need to press "Enter" Key

then we get relevant key in's output

I need to capture this output in some variable and verify the results later in main shell script.

Thanks,
Ops
# 2  
Old 04-22-2014
Hi Optimus;

Here is a code snippet that should help;

Code:
echo -n "Please input the duration of the run in whole hours:- "
read durn

###############################################################################
#
# Check that the duration is not to long, truncate if it is.
#
###############################################################################

if [ ${durn} -gt 12 ]
        then
        echo ""
        echo "You have selected ${durn} hours which is too long for the test to run."
        echo ""
        echo "Test duration has been trucated to 12 hours."
        durn=12
        export durn
fi

Regards

Gull04
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Wuhan Coronavirus Status App for China - Rapid Prototype using MQTT and the IoT OnOff IOS App

With a little bit of work, was able to build a nice "Wuhan Coronavirus Status" app using MQTT and the IoT-OnOff app. More on this technique here: ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages The result turned out nice, I think. I like the look and... (10 Replies)
Discussion started by: Neo
10 Replies

2. Shell Programming and Scripting

Automation Script for Oracle

Hi, As a Oracle Developer, I am writing many Procedures,Functions and Packages. Facing Many optimization issue after writing these Database objects. Trying to tune it manually. Can we write any Shell/Perl/Python script to Optimize these Database objects instead of doing manual check and... (1 Reply)
Discussion started by: vasuvv
1 Replies

3. Shell Programming and Scripting

Automation script

Hello All , I came across a tricky solution to devolop . Here is a part of the requirement automation . I have different set of server say : Web ( has 4 servers under it ) , App ( has 4 servers under it ) , DB ( has 2 servers under it ) Above each i have different load balancers , Say : Web... (4 Replies)
Discussion started by: radha254
4 Replies

4. Shell Programming and Scripting

awk script automation

I have the below code which calculates the time difference between src and dst from a large trace file. The code works for a given source and destination. However, I want to automate the code to go over any src and destination. The format of the source is like that: X.Y where x is always =2 and Y... (10 Replies)
Discussion started by: ENG_MOHD
10 Replies

5. Shell Programming and Scripting

Script Automation

Hi Gurus, I have a clearcase script that i use to check in a single file at time on my clearcase server. the script is as follows setmyview settask 75098_MSI_TRILOGY_EIM cd /vobs/Trilogy_R12/custom/msieim/12.0.0/sql/ cleartool co -nc . ct mkelem -nc Filename_1.sql cp... (3 Replies)
Discussion started by: r_t_1601
3 Replies

6. Shell Programming and Scripting

Boot/Shutdown script automation

Looking to automate some commands to run at boot and poweroff in a startup/shutdown script. How do I place it on the system so that it will be run automatically? I don't want to use cron, not quite specific enough, random times when I may boot or shutdown. ---------- Post updated at 10:47 PM... (8 Replies)
Discussion started by: 3therk1ll
8 Replies

7. Shell Programming and Scripting

Help with Swapinfo automation Alert script

I am new to unix scripting (HP-UX) and need to write a script for checking memory usage. I am using "ipcs -ma" and using "awk" to select specific colums and redirecting output to variable. /usr/bin/ipcs -ma | awk '{ print $5,$10,$12}' > $TMP_FILE exec < $TMP_FILE while read line; do ... (1 Reply)
Discussion started by: JamesBond007
1 Replies

8. Shell Programming and Scripting

Help with Shell Script automation

can someone look into this one please... I am struck at this point. I do not know what logic to be followed here. I can go ahead with my work only, if this step is done. Please Help. I have a process X in a shell script. Once the process X is done, it generates a log file. Process X is basically... (1 Reply)
Discussion started by: ss3944
1 Replies

9. Shell Programming and Scripting

FTP automation script

Hi, I have got a requirement like this. a parameterized function custFtp which will take 5 i/ps and will do the following tasks. p1) server name p2) username p3) password p4) path name of the server where the file resides p5) file name pattern the function will work like this. ... (1 Reply)
Discussion started by: ani_datta
1 Replies

10. Programming

Using make utility to create an mini-app

The following is my makefile. When I run "make", it gives me a bunch of error. I've compiled each file separately and there are no compilation errors. The target is "monprc". Have a look below: monprc: monprc.o monrep.o dsz.o cc -o monprc monprc.o monrep.o dsz.o monprc.o: monprc.c... (1 Reply)
Discussion started by: Yifan_Guo
1 Replies
Login or Register to Ask a Question