Skip to content
  • Hjem
  • Seneste
  • Etiketter
  • Populære
  • Verden
  • Bruger
  • Grupper
Temaer
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Kollaps
FARVEL BIG TECH
  1. Forside
  2. Ikke-kategoriseret
  3. Does it bother anyone else that $# in shell scripts and argc in C programs differ by one?

Does it bother anyone else that $# in shell scripts and argc in C programs differ by one?

Planlagt Fastgjort Låst Flyttet Ikke-kategoriseret
3 Indlæg 3 Posters 6 Visninger
  • Ældste til nyeste
  • Nyeste til ældste
  • Most Votes
Svar
  • Svar som emne
Login for at svare
Denne tråd er blevet slettet. Kun brugere med emne behandlings privilegier kan se den.
  • jef@mastodon.socialJ This user is from outside of this forum
    jef@mastodon.socialJ This user is from outside of this forum
    jef@mastodon.social
    wrote on sidst redigeret af
    #1

    Does it bother anyone else that $# in shell scripts and argc in C programs differ by one? That has always bothered me.

    barubary@infosec.exchangeB 1 Reply Last reply
    0
    • jef@mastodon.socialJ jef@mastodon.social

      Does it bother anyone else that $# in shell scripts and argc in C programs differ by one? That has always bothered me.

      barubary@infosec.exchangeB This user is from outside of this forum
      barubary@infosec.exchangeB This user is from outside of this forum
      barubary@infosec.exchange
      wrote sidst redigeret af
      #2

      @jef If you think about it wrong, it's actually off by two: $# is bash's argc minus 2.

      pelle@veganism.socialP 1 Reply Last reply
      0
      • barubary@infosec.exchangeB barubary@infosec.exchange

        @jef If you think about it wrong, it's actually off by two: $# is bash's argc minus 2.

        pelle@veganism.socialP This user is from outside of this forum
        pelle@veganism.socialP This user is from outside of this forum
        pelle@veganism.social
        wrote sidst redigeret af
        #3

        @barubary @jef
        what are the contents of those 3 args for the C program then? ( or are there just 2, and C is not using zero-indexing in this particular place?)

        1 Reply Last reply
        0
        Svar
        • Svar som emne
        Login for at svare
        • Ældste til nyeste
        • Nyeste til ældste
        • Most Votes


        • Log ind

        • Login or register to search.
        Powered by NodeBB Contributors
        Graciously hosted by data.coop
        • First post
          Last post
        0
        • Hjem
        • Seneste
        • Etiketter
        • Populære
        • Verden
        • Bruger
        • Grupper