The UNIX and Linux Forums  

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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-08-2008
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?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-08-2008
Moderator
 

Join Date: Feb 2007
Posts: 3,549
Try this:

Code:
echo "Y"| hdiutil mount /Install_Teacher_express.dmg
Regards
Reply With Quote
  #3 (permalink)  
Old 10-08-2008
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.
Reply With Quote
  #4 (permalink)  
Old 10-08-2008
cfajohnson's Avatar
Shell programmer, author
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 1,973
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
Reply With Quote
  #5 (permalink)  
Old 10-09-2008
Registered User
 

Join Date: Sep 2008
Posts: 27
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 07:36 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66