Jonkman Microblog
  • Login
Show Navigation
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. this page intentionally left (taiganaut@quitter.se)'s status on Thursday, 12-Oct-2017 01:29:20 EDT this page intentionally left this page intentionally left
    $ var="Hello World"
    $ echo ${var,,}
    hello world

    wat #bash #shell #wat
    In conversation Thursday, 12-Oct-2017 01:29:20 EDT from quitter.se permalink
    1. clacke (clacke@social.heldscal.la)'s status on Thursday, 12-Oct-2017 01:45:05 EDT clacke clacke
      in reply to
      @taiganaut Well yeah, that's what that syntax means. :-)

      I can't imagine there is something in particular one would intuitively expect it to mean.
      In conversation Thursday, 12-Oct-2017 01:45:05 EDT from social.heldscal.la permalink
      1. this page intentionally left (taiganaut@quitter.se)'s status on Thursday, 12-Oct-2017 02:06:42 EDT this page intentionally left this page intentionally left
        in reply to
        @clacke why does it come out lower case?
        In conversation Thursday, 12-Oct-2017 02:06:42 EDT from quitter.se permalink
        1. clacke (clacke@social.heldscal.la)'s status on Thursday, 12-Oct-2017 02:07:18 EDT clacke clacke
          in reply to
          @taiganaut Because ${variablename,,} literally means "make this shit lower case".
          In conversation Thursday, 12-Oct-2017 02:07:18 EDT from social.heldscal.la permalink
          1. clacke (clacke@social.heldscal.la)'s status on Thursday, 12-Oct-2017 02:10:21 EDT clacke clacke
            in reply to
            @taiganaut

            https://www.gnu.org/software/bash/manual/bash.html#index-parameter-expansion

            > ${parameter^pattern}
            > ${parameter^^pattern}
            > ${parameter,pattern}
            > ${parameter,,pattern}
            [ . . . ]
            > The ‘^’ operator converts lowercase letters matching pattern to uppercase; the ‘,’ operator converts matching uppercase letters to lowercase. The ‘^^’ and ‘,,’ expansions convert each matched character in the expanded value
            In conversation Thursday, 12-Oct-2017 02:10:21 EDT from social.heldscal.la permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.

Switch to desktop site layout.