Python Forum
script to check bash scripts
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
script to check bash scripts
#3
Just to mention that l is as str, thus

if l and l[0]=='#': is better just if l.startswith("#"): and
if l and l[-1]=='}': is better as if l.endswith("}"):

this way you avoid having to check it's not an empty string
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
script to check bash scripts - by Skaperen - Sep-18-2019, 12:16 AM
RE: script to check bash scripts - by DeaD_EyE - Sep-18-2019, 06:31 AM
RE: script to check bash scripts - by buran - Sep-18-2019, 07:49 AM
RE: script to check bash scripts - by Skaperen - Sep-19-2019, 10:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  A bash script that is a hack to enable very easy Python Imports vedant13 2 3,195 Aug-04-2018, 06:10 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020