A
A
Aryeh Leonid R.2012-09-04 21:18:30
linux
Aryeh Leonid R., 2012-09-04 21:18:30

How to quickly "translate" Shell script for Mac OS X?

Not too long ago, I completed a unit-test for my module. The system runs on a linux server, the module is written in C, the tests are in Python, and everything is started by a Shell script (150-170 lines).
And now it became necessary to run tests on Mac OS X.
I had only seen Macs in pictures before and knew that the system was UNIX-like. Well, I think Shell is the same. It turned out that everything is not as simple as I thought.
For example cp -rf src dest doesn't work.
And hostname -i doesn't work.
What to do? Is there a similarity of cygwin for Mac OS X?
Or a "translator's" manual?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ilya_Drey, 2012-09-04
@Ilya_Drey

cp -Rf src dst
arp -n `hostname` | sed 's/.*[(]\(.*\)[)].*/\1/g' - but I'm not sure about this, maybe it's easier for you to take ip from ifconfig :)

V
Vovanys, 2012-09-04
@Vovanys

cp -rf src dest works, hostname doesn't...
in mac the commands are slightly replaced by others, or you need to change the combination...
the same route -n in linux, it doesn't plow in mac... replaced by netstat -rn
in general, you can just replace the commands...

A
Aryeh Leonid R., 2012-09-04
@aryeh

thank. dealt with these examples. but there are many more!
is there no guide? or a cygwin equivalent for Mac OS X?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question