Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #269162

Re: realpath quoting

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: realpath quoting
Date 2024-05-03 04:20 +0200
Message-ID <IzQGJ-aHiZ-3@gated-at.bofh.it> (permalink)
References <IzNIR-aFv9-1@gated-at.bofh.it> <IzQGJ-aHiZ-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, May 02, 2024 at 07:11:46PM -0700, David Christensen wrote:
> Perhaps Perl and the module String::ShellQuote ?
> 
> 2024-05-02 18:50:28 dpchrist@laalaa ~
> $ touch "name with spaces"
> 
> 2024-05-02 18:50:45 dpchrist@laalaa ~
> $ touch "name with\nnewline"

You didn't create a name with a newline in it here.  You created a name
with a backslash in it.  If you wanted a newline, you would have to use
the $'...' quoting form (in bash).

    touch $'name with\nnewline'

> 2024-05-02 19:06:01 dpchrist@laalaa ~
> $ perl -MString::ShellQuote -e 'print shell_quote(@ARGV), "\n"' name*
> 'name with spaces' 'name with\nnewline'

I still insist that this is a workaround that should *not* be used
to try to cancel out quoting bugs in one's shell scripts.  Just write
the shell scripts correctly in the first place.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

realpath quoting jeremy ardley <jeremy.ardley@gmail.com> - 2024-05-03 01:10 +0200
  Re: realpath quoting Greg Wooledge <greg@wooledge.org> - 2024-05-03 01:40 +0200
    Re: realpath quoting Greg Wooledge <greg@wooledge.org> - 2024-05-03 01:50 +0200
    Re: realpath quoting jeremy ardley <jeremy.ardley@gmail.com> - 2024-05-03 01:50 +0200
  Re: realpath quoting David Christensen <dpchrist@holgerdanske.com> - 2024-05-03 04:20 +0200
    Re: realpath quoting Greg Wooledge <greg@wooledge.org> - 2024-05-03 04:20 +0200
      Re: realpath quoting Max Nikulin <manikulin@gmail.com> - 2024-05-03 05:00 +0200
        Re: realpath quoting jeremy ardley <jeremy.ardley@gmail.com> - 2024-05-03 06:40 +0200
          Re: realpath quoting Greg Wooledge <greg@wooledge.org> - 2024-05-03 13:10 +0200
            Re: realpath quoting jeremy ardley <jeremy.ardley@gmail.com> - 2024-05-03 13:40 +0200
              Re: realpath quoting Sirius <sirius@trudheim.com> - 2024-05-03 13:50 +0200
              Re: realpath quoting David Christensen <dpchrist@holgerdanske.com> - 2024-05-03 21:20 +0200
          Re: realpath quoting Max Nikulin <manikulin@gmail.com> - 2024-05-03 17:20 +0200
        Re: realpath quoting David Christensen <dpchrist@holgerdanske.com> - 2024-05-03 07:40 +0200
          Re: realpath quoting Tom Browder <tom.browder@gmail.com> - 2024-05-04 15:30 +0200
            Re: realpath quoting Greg Wooledge <greg@wooledge.org> - 2024-05-04 16:00 +0200
      Re: realpath quoting David Christensen <dpchrist@holgerdanske.com> - 2024-05-03 07:20 +0200
        Re: realpath quoting Greg Wooledge <greg@wooledge.org> - 2024-05-03 13:10 +0200
          Re: realpath quoting David Christensen <dpchrist@holgerdanske.com> - 2024-05-03 20:50 +0200
  Re: realpath quoting Teemu Likonen <tlikonen@iki.fi> - 2024-05-03 06:50 +0200

csiph-web