1416 links
  • Animal
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
page 1 / 1
1 results tagged Argument x
  • How to get the nth positional argument in bash? - Stack Overflow

    Pour récupérer le n-ème argument en bash:

    #!/bin/bash
    n=3
    echo "${!n}"

    Résultat:

    bash script.sh voiture camion "tati danielle" raclette "pommes de terre" exponentielle logarithme
    tati danielle

    Et pour récupérer les m premiers arguments à partir du n-ème (compris):

    #!/bin/bash
    n=4
    m=2
    echo "${@:$n:$m}

    Résultat:

    bash script.sh voiture camion "tati danielle" raclette "pommes de terre" exponentielle logarithme
    raclette pommes de terre
    Wed May 31 18:27:46 2017 * - permalink -
    QRCode
    - https://stackoverflow.com/questions/1497811/how-to-get-the-nth-positional-argument-in-bash
    Argument Astuce Bash Linux Script stackoverflow.com
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation