Can I fully replace GNU Bash with Python?

  • Thread starter Jason Hsu, Mr. Swift Linux
  • Start date

J

Jason Hsu, Mr. Swift Linux

This question concerns my process of creating Swift Linux from the
base distro (antiX Linux in the past, Linux Mint Debian Edition now).
(NOTE: The process I'm describing here is an oversimplification.)

All of my development work takes place in the ~/develop directory.
This is the directory where I enter the "git clone" command to
download the repositories from GitHub. These repositories are 1-
build, majorfunction1, majorfunction2, and so on. After I download
these repositories, I have the directories ~/develop/1-build, ~/
develop/majorfunction1, ~/develop/majorfunction2, and so on.

The ~/develop/1-build directory contains the scripts that build Swift
Linux. Each major function needed to create Swift Linux (such as
changing web browser configuration files, changing login manager
configuration files, etc.) has its own majorfunction# repository.

For developing the latest version of Swift Linux, I had the swift.sh
script in the ~/develop/1-build directory call scripts in the
majorfunction directories with commands like:
sh ~/develop/majorfunction1/main.sh
sh ~/develop/majorfunction2/main.sh
and so on

Please note that one can run any of these major functions
independently OR as part of the ~/develop/1-build/swift.sh script.
The ability to run any major function independently means I can focus
on just one function that's not working as it should WITHOUT messing
around with other functions. This ability will be especially
important when I have an actual team working on Swift Linux.

What I'd like to do is replace GNU Bash with Python. I know I can
replace the main.sh scripts with main.py scripts. Then the commands
in the swift.sh script would be:
python ~/develop/majorfunction1/main.py
python ~/develop/majorfunction2/main.py
and so on

Is there a way I can replace the ~/develop/1-build/swift.sh script
with a ~/develop/1-build/swift.py script, yet still retain the ability
to work on one major function WITHOUT requiring the other major
functions and the 1-build directory to be present?
 
Ad

Advertisements

D

Devin Jeanpierre

Is there a way I can replace the ~/develop/1-build/swift.sh script
with a ~/develop/1-build/swift.py script, yet still retain the ability
to work on one major function WITHOUT requiring the other major
functions and the 1-build directory to be present?

I thought I followed along, but I don't see where the problem is here.
Did you try something and it didn't work, or are you asking if in
principle it can work?

In principle, it can work fine. the mainfunction modules can be
importable modules with some functions, or they can be (like they are
in sh) runnable scripts called by your build script, or whatever. You
can diverge as much as you want from how sh works, or stay as close as
you want, down to the level of only interoperating with other python
modules by invoking them as programs.

Devin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top