Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1035883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:36:49+00:00 2026-05-16T14:36:49+00:00

I need to write a script to do the following: Monitor a queuing system,

  • 0

I need to write a script to do the following:

  1. Monitor a queuing system, which is accessible by shell commands.
  2. Create directories from templates using a mix of inline text editing, cp/mv, command line scripts, and compiled c++ programs.
  3. Check for error conditions.
  4. Write files on error conditions.

Note: 2D arrays would be mildly useful to my program, but I’m currently making due with several 1D arrays (due to the limitations of Bash script’s arrays).

Those tasks all seems somewhat “shell heavy” in so much as it can easily be implemented with a bunch of shell commands, so I thought Bash scripting would be a natural way to go. My results thus far have been good, but before I begin refactoring and finalizing my code, I was wondering whether it’d be better to port it to Python. I’ve read in numerous places that Python is “superior” to bash. I’ve done a bit of Python scripting and as far as I can tell, that’s because it has more built in libraries and has support for object-oriented programming. However, all the scripts I’ve seen using shell commands, such as this one:
http://magazine.redhat.com/2008/02/07/python-for-bash-scripters-a-well-kept-secret/

Implement obnoxious syntax, like having to define commands as variables, like so:

#You could add another bash command here
#HOLDING_SPOT="""fake_command"""

#Determines Home Directory Usage in Gigs
HOMEDIR_USAGE = """
du -sh $HOME | cut -f1
"""

#Determines IP Address
IPADDR = """
/sbin/ifconfig -a | awk '/(cast)/ { print $2 }' | cut -d':' -f2 | head -1
"""

…and requiring wrapper functions and other fun.

Am I just being silly or does that seem less intuitive? Is there a speed advantage for use with Python that would outweigh the simplicity advantage of Bash when it comes to shell script commands? Or is the syntax of bash (no 2D arrays, brace/parentheses intricacies) reason to jump to Python?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:36:50+00:00Added an answer on May 16, 2026 at 2:36 pm

    If you can’t find a reason to switch it’s probably because there’s no reason.

    I started to switch python because some of my scripts require some templating process that was easier to do in other than shell script.

    There were also another scripts which required configuration file parsing or parameter parsing that make me learn a bit more of python, and finally another ones which deal with trac (coded in python) who made me switch to python.

    But if you could outline your scripts in bash fast and cleanly without require another tool, remain in bash, it is a great tool.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write a script in Matlab, which will read some data from
I need to write a script which will post username and password onto a
I need to write a script that incrementally keeps track of files and directories
I need to write a script in SQL 2008 R2 integration Services to CREATE
I need to write a shell script to be scheduled to run daily to
I need to write a Shell Script to process a huge folder of nearly
I need to write a script that does the following: # open a tiff
I'm not a programmer/scripter. I just need to get the following script to write
I need to write a script which looks at a file and replaces any
I would like to write Python script, which will get i.e. 100 news/texts from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.