Register FAQ/Rules Forum Spy Search Today's Posts Mark Forums Read

Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate.

 
Go Back   Mac Forums > Apple Hardware > Buying Tips, Advice and Discussion
TouchArcade.com - iPhone Game Reviews and News

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 25, 2005, 11:00 AM   #1
VecsKrakjis
macrumors newbie
 
Join Date: Dec 2005
Compile sh* or bat* files on MAC

need help with compiling sh* or bat* files on MAC, need advice which program i need to use to do that?

It need to look something like this..
So i need a software to compile something like this?
:::

javac -cp .;./../OUTPUT;./../OUTPUT/unrenamed.jar; ./../OUTPUT/sign/*.java ./../OUTPUT/*.java *.java
javac -cp .;./../BotClasses;./../OUTPUT;./../OUTPUT/unrenamed.jar;./LIB/; *.java
javac -cp ../LIB;.;./../BotClasses;./../OUTPUT;./../OUTPUT/unrenamed.jar; *.java
java -noverify -Xmx500m -cp .;./OUTPUT;./OUTPUT/unrenamed.jar;./BotClasses;./LIB; Bot %1

???????????

Last edited by VecsKrakjis : Dec 25, 2005 at 11:10 AM.
VecsKrakjis is offline   Reply With Quote
Old Dec 25, 2005, 02:32 PM   #2
generik
Banned
 
generik's Avatar
 
Join Date: Aug 2005
Location: Minitrue
Nope..

What you do is
chmod +x <xxx.sh>
./xxx.sh

generik is offline   Reply With Quote
Old Dec 25, 2005, 06:02 PM   #3
notjustjay
macrumors 68030
 
notjustjay's Avatar
 
Join Date: Sep 2003
Location: Canada, eh?
Or more to the point, .sh files are shell scripts which don't need to be compiled into an executable file -- as a script they are simply interpreted, line by line, by the shell. A .bat file is a "batch" file which has roots in MS-DOS.

generik's instructions show you how to change permissions to allow the .sh file to be executable, and then how to actually run the script (note that in Unix you need to explicitly specify that the file you want is in the current directory, by using the "./" prefix on your filename... although slightly inconvenient, and easily circumventable, it is good practice for system security).

Hope that helps.
notjustjay is offline   Reply With Quote
Old Jan 7, 2006, 08:36 PM   #4
rockstar
macrumors newbie
 
Join Date: Jan 2006
sh and unix executable files

I am running OSX. I need to execute a unix executable file and then run a shell script.
I've copied the exec file "transform" and *.sh file into the directory in which I want to run it. Then from X11 I go to that directory and type ./transform but receive the error message:
tcsh: ./transform: Exec format error. Binary file not executable.

This file was created with a f90 compiler at work (unix) and then copied to my mac. do I need to recompile it? If so how do I do that on mac?

Then I need to run a shell script from within the same directory. Do I need to type /bin/sh *.sh ??

help needed, thanks.
rockstar is offline   Reply With Quote
Old Jan 7, 2006, 10:01 PM   #5
cubist
macrumors 68000
 
Join Date: Jul 2002
Location: Muncie, Indiana
Send a message via AIM to cubist
You cannot expect a binary executable file "transform" from your work system to work on the Mac. This is because they probably have different types of CPUs.

If you were using Java .jar files, they would work.

Also, I don't think the Mac comes with f90, it might come with f77, you could possibly transfer the Fortran source to the Mac and recompile it.
cubist is offline   Reply With Quote
Old Jan 7, 2006, 10:09 PM   #6
csubear
macrumors 6502a
 
csubear's Avatar
 
Join Date: Aug 2003
Quote:
Originally Posted by cubist
You cannot expect a binary executable file "transform" from your work system to work on the Mac. This is because they probably have different types of CPUs.

If you were using Java .jar files, they would work.

Also, I don't think the Mac comes with f90, it might come with f77, you could possibly transfer the Fortran source to the Mac and recompile it.

You could use fink to install g77. I don't think there is a free f90 complier for OS X.
__________________
(\_/)
(-.-)
(><)o
csubear is offline   Reply With Quote
Old Jan 8, 2006, 12:28 AM   #7
rockstar
macrumors newbie
 
Join Date: Jan 2006
fortran compiler for Mac

Thank you for the helpful responses. Indeed I already had g77 and f77 but neither seem to compile the f90 file. Maybe this is obvious.

My command statement and error response was as follows:

[athena:~] rockhopp% g77 ~/Desktop/transfer.f90 -o ~/Desktop/transform
/usr/bin/ld: /Users/rockhopper/Desktop/transfer.f90 bad magic number (not a Mach-O file)
collect2: ld returned 1 exit status

Should I be doiong something different here? Alternatively, on Fink, there exists a g95, will this work as a compiler for an f90 program?

newbie
rockstar is offline   Reply With Quote
Old Jan 8, 2006, 12:40 AM   #8
bousozoku
Retired (Moderator emeritus)
 
Join Date: Jun 2002
Location: Gone but not forgotten.
Quote:
Originally Posted by rockstar
Thank you for the helpful responses. Indeed I already had g77 and f77 but neither seem to compile the f90 file. Maybe this is obvious.

My command statement and error response was as follows:

[athena:~] rockhopp% g77 ~/Desktop/transfer.f90 -o ~/Desktop/transform
/usr/bin/ld: /Users/rockhopper/Desktop/transfer.f90 bad magic number (not a Mach-O file)
collect2: ld returned 1 exit status

Should I be doiong something different here? Alternatively, on Fink, there exists a g95, will this work as a compiler for an f90 program?

newbie
It would seem that you don't have a compiler that was compiled for Mac OS X. Other than scripts and other interpreted code, you can't just pull code from another system and run it.
bousozoku is offline   Reply With Quote
Old Jan 8, 2006, 12:55 AM   #9
rockstar
macrumors newbie
 
Join Date: Jan 2006
Mac fortran compiler

Thank you for your response. It is my understanding that g77 and f77 and g95 are Fortran compilers for Mac. My question is: it is likely that g77/f77 won't compile an f90 file (is this correct?) because f90 is a more recent language, but will a g95 compile an f90 file?
rockstar is offline   Reply With Quote

Reply

Mac Forums > Apple Hardware > Buying Tips, Advice and Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:53 PM.

Mac News | Mac Rumors | iPhone Game Reviews | iPhone Apps

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2002-2009, MacRumors.com, LLC