The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
shell script that adds two integers and display answer on screen wanyac2 Shell Programming and Scripting 1 07-04-2008 09:37 AM
Shell script answer prompts? eltinator Shell Programming and Scripting 4 08-29-2007 11:15 AM
Shell script fundamental Questions pankajkrmishra Shell Programming and Scripting 2 07-21-2006 02:14 AM
urgent- please answer these set of questions uni_ajay_r UNIX for Dummies Questions & Answers 6 05-14-2006 09:35 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-08-2008
The Reepr The Reepr is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 5
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 (permalink)  
Old 10-08-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,212
Try this:

Code:
echo "Y"| hdiutil mount /Install_Teacher_express.dmg
Regards
  #3 (permalink)  
Old 10-08-2008
The Reepr The Reepr is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 5
hdiutil mount /Install_Teacher_express.dmg | echo "Y"

is the command I used.

It Worked! Thanks a bunch.
  #4 (permalink)  
Old 10-08-2008
cfajohnson's Avatar
cfajohnson cfajohnson is online now Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,311
Quote:
Originally Posted by The Reepr View Post
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 (permalink)  
Old 10-09-2008
ikorolev ikorolev is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 40
Quote:
Originally Posted by The Reepr View Post
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
Code:
# printf "y
Yes
Yes
n
/path/to/file
" > /tmp/answers
# my_script.sh < /tmp/answers
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:21 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0