• 0 Posts
  • 5 Comments
Joined 8 days ago
cake
Cake day: February 14th, 2025

help-circle


  • LeninOnAPrayer@lemm.eetoLinux@lemmy.mlHappy with my bash progress!
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    6 days ago

    Yes. You’re correct. The script will execute with /bin/bash by default but only in a bash shell. #!/bin/bash is still a good habit to have. Some platforms may be running an “sh” shell by default. In this case if you ran the script it would execute with /bin/sh instead. Which would work or not work depending on if your script was written in purely sh syntax and not using any uniquely bash style syntax.

    Bash can run all sh scripts but sh cannot run all bash scripts. So explicitly stating for which one your script was written for is good practice to not run into errors if you move your script to a different environment.


  • LeninOnAPrayer@lemm.eetoLinux@lemmy.mlHappy with my bash progress!
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    6 days ago

    It makes it usable without typing bash. Same would apply for a python script. For example you can make a python script named with no extension and add #!/usr/bin/python to the top of the file. Bash shell sees this and knows to execute the script using that python path.

    Then you just include the directory in your $PATH and chmod +x the script. Then you can type $python_script instead of $python python_script.py


  • LeninOnAPrayer@lemm.eetoMemes@lemmy.mlLiberals
    link
    fedilink
    English
    arrow-up
    10
    ·
    6 days ago

    Protests, strikes, or boycotts with a planned end date are next to useless. You can do that if it makes you feel good. But don’t do it in place of real organizing. The best thing you can do now is organizing locally. Join your local PSL and support what they are doing.