Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why embed repo command in a bash script?

I was investigating repo (from Android project) source code. It start with the following :

#!/bin/sh
magic='--calling-python-from-/bin/sh--'
"""exec" python -E "$0" "$@" """#$magic"

If I understand it well, it means that the script is recalling itself with python. So there is my question, why do not directly use python.

For example I usually use something like :

#!/usr/bin/env python

I think there is a valuable reason, but I can't figure it out.

Thanks

like image 424
needle Avatar asked Mar 03 '11 12:03

needle


1 Answers

Answer from the repo people: Purpose of embedding Repo python code into bash script

like image 80
js. Avatar answered Oct 27 '22 21:10

js.