10 votes

Writing safe shell scripts

5 comments

  1. [5]
    acdw
    Link
    I'll come right out and say it: shell is still the only language I'm truly comfortable writing. The glue and pipe metaphor makes so much sense to me, and I just want it in other languages. I got...

    I'll come right out and say it: shell is still the only language I'm truly comfortable writing. The glue and pipe metaphor makes so much sense to me, and I just want it in other languages. I got close with Haskell, but the higher level type stuff confused me.

    If anyone has any tips or references that lifted them out of shell and into another language, I'd be happy to hear them. Most tutorials start from the VERY beginning, which doesn't work for me since I know about basic types and how to install things.

    4 votes
    1. [2]
      Micycle_the_Bichael
      Link Parent
      I'll take the opposite stance here. I hate shell so much. It is faster for me to import modules in python that allow me to make basic UNIX commands and then do the rest of my work in python than...

      I'll take the opposite stance here. I hate shell so much. It is faster for me to import modules in python that allow me to make basic UNIX commands and then do the rest of my work in python than it is for me to spend 30 minutes trying to figure out to properly use [, [[, (, ((, { in an if statement, or to try to figure out how to parse data down to only get what I need by using awk or sed. Shell makes 0 sense to me, I hate it, I avoid it at every step, and I am so thankful to work in a shop where we are replacing as many shell scripts as possible with python.

      That's not to say your opinion is wrong. If bash works for you and you can code in it, great. A+ I support you. Everyone should feel welcome to use the tools they are comfortable with. I'm just saying that for me, shell makes no sense and I welcome any and all possible replacements.

      5 votes
      1. acdw
        Link Parent
        Your take is definitely the popular one! I honestly want to learn python better, but I don't really know where to begin. I know basic stuff about control flow, strings, syscalls, etc., but I don't...

        Your take is definitely the popular one! I honestly want to learn python better, but I don't really know where to begin. I know basic stuff about control flow, strings, syscalls, etc., but I don't grok the Object model or organizing a project's directories. (Modules?) If you have any advice in those areas I'd appreciate it!

        2 votes
    2. [2]
      ainar-g
      Link Parent
      Have you tried Tcl? It's like a half-way point between Shell and programming languages like Perl, Python, or Ruby.

      Have you tried Tcl? It's like a half-way point between Shell and programming languages like Perl, Python, or Ruby.

      3 votes
      1. acdw
        Link Parent
        I haven't; I'll have to check it out!

        I haven't; I'll have to check it out!

        3 votes