Answer Terminal Questions With Shell Script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Answer Terminal Questions With Shell Script?
# 1  
Old 10-08-2008
Answer Terminal Questions With Shell Script?

First off, I am using Mac OS X, with Apple Remote Desktop.

I have to install several app's on teachers' laptops which are on several cd's that I have made disk images of. (DMG's)

To do rollouts quicker, I have written a script to mount the disk images and running the installers inside each of the disk images (this is not done yet, but in progress)

Here's the script.
Code:
#!/bin/sh

#Version .1a, by XXXXXXXX

##Installer script for TeacherEXPRESS apps and expansion packs

##First, mount the DMG files

##Usage: hdiutil mount AppName.dmg

cd /

##Change to /Science for final run
hdiutil mount /Install_Teacher_express.dmg

Now when I run the script I get:

Code:
Are you sure you want to mount the image? (Y/N)

Is there a way for me to answer Y?
# 2  
Old 10-08-2008
Try this:

Code:
echo "Y"| hdiutil mount /Install_Teacher_express.dmg

Regards
# 3  
Old 10-08-2008
hdiutil mount /Install_Teacher_express.dmg | echo "Y"

is the command I used.

It Worked! Thanks a bunch.
# 4  
Old 10-08-2008
Quote:
Originally Posted by The Reepr
Now when I run the script I get:

Code:
Are you sure you want to mount the image? (Y/N)

Is there a way for me to answer Y?
Code:
man yes

# 5  
Old 10-09-2008
Quote:
Originally Posted by The Reepr
Code:
Are you sure you want to mount the image? (Y/N)

Is there a way for me to answer Y?
make file with all answers (no only Y, for example - with path or your name)
and can automatize installation any software Smilie
Code:
# printf "y
Yes
Yes
n
/path/to/file
" > /tmp/answers
# my_script.sh < /tmp/answers

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need some help in formatting answer of shell script

Dear all, I am new to shell scripting and have tried to make a small program for fun sake that tells age from the last number of cell phone and birth year. At the end we get a final 3 digit number and the first digit represents the last digit of cell phone and rest 2 numbers shows age. eg. 423... (4 Replies)
Discussion started by: stg44
4 Replies

2. Solaris

==please answer the following questions==

Hello :) ! i've few doubts. 1) how can we find the newly attached disk in SOLARIS ? 2) how to change port number of a service ? 3) how can we find that autofs is running in our system without using svcs and prstat commands ? 4) we know that there are several types of dns servers in... (0 Replies)
Discussion started by: vamshigvk475
0 Replies

3. UNIX for Dummies Questions & Answers

Need answer for these LINUX questions URGENT!!

I am very new to LINUX and could not find answer to these questions please submit your comments and suggestions to answer these questions. Appreciate your time thank you, :) 1. Make sure there is no filename1.txt in current directory first. Now, enter vi with "vi filename1.txt" command. vi... (4 Replies)
Discussion started by: linux17
4 Replies

4. UNIX for Dummies Questions & Answers

Need answer for these LINUX questions URGENT!!

I am very new to LINUX and could not find answer to these questions please submit your comments and suggestions to answer these questions. Appreciate your time thank you, :) If you look at the permissions associated with a symbolic link, it has universal access. Does this lead to security... (0 Replies)
Discussion started by: linux17
0 Replies

5. Solaris

Please give me answer for these interview questions.

As i'm going to attend my first interview day after tomorrow, What should i need to answer if the interviewer asked me about 1. Tell me about your production environment. 2. What about your team size? 3. Tell me about the most critical situation/issue you have ever faced. Can any... (10 Replies)
Discussion started by: Sesha
10 Replies

6. Shell Programming and Scripting

How to answer the Questions in Perl .

I need to write a script to telnet or ssh a device the execute some commands in device then copy the output in a file, I wrote the script but I faced one issue, when you execute some commands the device asked me a Question, for example : device # copy run tftp device # Source filename ? ... (3 Replies)
Discussion started by: DarkSoul
3 Replies

7. UNIX for Dummies Questions & Answers

can any one please answer these questions

6.nohup cmn is used to Prot execn of pgm frm aborting when hangup s/g is rxd Not hangup modem Disconn a node frm s/m Chng execn prev of pgm .wat is the o/p? Cut -d”” -f3 file1/sort -r Display 3rd col of file 1 in asc order Disp 3rd col of file 1 in desc Not ... (1 Reply)
Discussion started by: techguru
1 Replies

8. Shell Programming and Scripting

Shell script answer prompts?

Hi, I'm writing a script that calls a function to generate a certificate. In generating this certificate, I'm asked a series of questions. I was wondering, is there a way to pre-program my script to answer these questions in the same way all the time. I saw something like EOF>> y EOF ... (4 Replies)
Discussion started by: eltinator
4 Replies

9. UNIX for Dummies Questions & Answers

urgent- please answer these set of questions

Hi, I have a few questions to be answered.Please help me out in this.Its urgent. 1) what does ' $* ' mean, what does it do ? 2) Command to change UNIX Password. 3) What is Daemon processes ? 4) How do u execute a Unix command or process in the background ? 5) What is nohup ? 6) Difference... (6 Replies)
Discussion started by: uni_ajay_r
6 Replies
Login or Register to Ask a Question