How to install .dmg using shell script


 
Thread Tools Search this Thread
Operating Systems OS X (Apple) How to install .dmg using shell script
# 1  
Old 04-25-2012
How to install .dmg using shell script

I want to write a script to install an application using .dmg file.
.dmg file already exists in the folder.


working on MAC OS.
# 2  
Old 04-25-2012
This User Gave Thanks to itkamaraj For This Post:
# 3  
Old 04-25-2012
Java

hey itkamaraj thanks for all the help..

i need some more help Smilie

Actually now i am trying to so something like this:]

Code:
awk -v new="3.1.0.5" -F"[<>]" '/CFBundleVersion/ {getline;current=$3;exit}END{if(new>current){
print "NOT OK"
hdiutil mount AdobeAIR.dmg
#sudo cp -R "/Volumes/AdobeAIR of the AdobeAIR/ of the AdobeAIR.app" /Applicatio#ns
}else{
print "OK"
}}' Info.plist

Smilie

For which i am getting following error:

awk: syntax error at source line 3
context is
hdiutil mount >>> AdobeAIR. <<< dmg
awk: illegal statement at source line 4



HELP!
# 4  
Old 04-25-2012
Hi, awk is not a shell, so it complains about hdiutil...
This User Gave Thanks to Scrutinizer For This Post:
# 5  
Old 04-25-2012
execute the awk command alone. and store the result ( "OK" or "NOT OK" ) in a variable.

Then use if condition to check the variable value and do the installation
This User Gave Thanks to itkamaraj For This Post:
# 6  
Old 04-25-2012
Smilie
Code:
awk -v new="3.1.0.5" -F"[<>]" '/CFBundleVersion/ {getline;current=$3;exit}END{if(new>current){result="NOT OK"}else{result="OK"}}' Info.plist
echo $result

output is Nothing: BLANK

seems i don't know anything about shell scripts Smilie


and ya i tried:

Code:
$ hdiutil mount AdobeAIR.dmg

OUTPUT:
/dev/disk1 Apple_partition_scheme
/dev/disk1s1 Apple_partition_map
/dev/disk1s2 Apple_HFS /Volumes/Adobe AIR


After this how should I copy? following is not working:

Code:
$ sudo cp -R "/Volumes/Adobe AIR of the Adobe AIR/ of the AdobeAIR.app" /Applications

Error:
cp: /Volumes/Adobe AIR of the Adobe AIR/ of the AdobeAIR.app: No such file or directory
# 7  
Old 04-25-2012
Code:
result=$(awk -v new="3.1.0.5" -F"[<>]" '/CFBundleVersion/ {getline;current=$3;exit}END{if(new>current){print "NOT OK"}else{print "OK"}}' Info.plist)
echo $result

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Restore .dmg containing multiple partitions to bootable USB flash drive

I have a .dmg file which was created from a disk consisting of two partitions. When I mount the dmg both partitions pop up, so I know the imaging worked properly. One partition is HFS+ and the other is FAT32. So far, I've been unable to find a way to restore the dmg to a flash drive where both... (17 Replies)
Discussion started by: paulcristo
17 Replies

2. Shell Programming and Scripting

Shell script to install and set JAVA_HOME as non root user

HI I am trying to install JAVA and set JAVA_HOME variable in non-root user mode. I am trying to write a script for that. I am doing it by downloading a tar ball.Any inputs will be helpful. (1 Reply)
Discussion started by: sailu_mvn
1 Replies

3. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

4. Filesystems, Disks and Memory

Filesystem Problems with DMG

Hi all! I have a task that has been giving me problems.I have my sister-in-law's external hard drive that has been damaged and the filesystem is not mountable. I am on a Mac running OSX 10.6.8 Using ddrescue, I recovered the contents and transferred to my external drive: sudo ddrescue... (0 Replies)
Discussion started by: Imhotep1963
0 Replies

5. Solaris

Unable to install Sol10 on V245, exiting to shell.

Hi there, OK so I am super-green, but I have a problem I am hoping someone can help me with. I have a V245 that I am unable to install Solaris 10 (10/09) onto as during the initial install process, the UI pops up for region selection, but then as I enter my region, identify the system, up comes... (21 Replies)
Discussion started by: wallrunn3r
21 Replies

6. Ubuntu

Using "apt-get install" in shell script

Hi, I want to install certain packages on my Ubuntu 8.04 32-bit machine. I am doing it via the following shell script. #!/bin/bash while read -r pkg do apt-get install --force-yes "$pkg" && { continue; } done < list_of_packages.txt The problem I am facing is, I am not able... (2 Replies)
Discussion started by: royalibrahim
2 Replies

7. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

8. Shell Programming and Scripting

how to Install jdk.bin using shell script with auto yes/no?

#!/bin/sh echo "Installing Java!!!" cd /opt echo "Want to give execute Permissions to java!!!" chmod 755 jdk-6u7-linux-i586.bin echo "Executing the jdk script" ./jdk-6u7-linux-i586.bin This is the shell commands I am using... I want to know how to give answer to yes and no automatically... (6 Replies)
Discussion started by: sandeepbharmori
6 Replies

9. Linux

install macbook pro fedora10 ???((<<if can install, how to install? >> ))

If may install can Tells everybody ??? (0 Replies)
Discussion started by: kzBSD
0 Replies

10. HP-UX

Failed to install shell script compiler (shc)

I have install gcc, downloaded shc-3.8.6 and extracted in /install > cd /install/shc-3.8.6 > export CC=/usr/local/bin/gcc > make cleanall > make test "Makefile" 72 lines, 1526 characters # make test /usr/local/bin/gcc -Wall -O6 -pedantic shc.c -o shc *** Compiling script "match"... (0 Replies)
Discussion started by: alfredo
0 Replies
Login or Register to Ask a Question