On Sat, May 04, 2024 at 08:22:27AM -0500, Tom Browder wrote:
> $ cat read.raku
> #!/usr/bin/env raku
> my $a = "name with spaces";
> my $b = "name\nwith newline";
> say "file 1: |$a|";
> say "file 2: |$b|";
>
> And executing it:
>
> $ ./read.raku
> file 1: |name with spaces|
> file 2: |name
> wit
On Fri, May 3, 2024 at 21:43 David Christensen
wrote:
...
> My practice is to start with '#!/bin/sh' and migrate to '#!/usr/bin/env
> perl' as complexity increases.
I agree with David's direction, but ending with Raku instead of Perl.
I don't think golfing is the way to illustrate a practical so
Am 03.05.2024 um 21:11 schrieb David Christensen:
> I can obviously add an extra step to the process to convert the new file
> name to something acceptable before processing. However, my question was
> how to avoid that extra step by getting fully quoted filenames to process.
Today, on linux, i am
Am 03.05.2024 um 21:11 schrieb David Christensen:
> I can obviously add an extra step to the process to convert the new file
> name to something acceptable before processing. However, my question was
> how to avoid that extra step by getting fully quoted filenames to process.
Not sure, if i get it
On 5/3/24 04:34, jeremy ardley wrote:
On 3/5/24 19:06, Greg Wooledge wrote:
I would suggest that if you need to use a debugger to track down a bug
in your program, you should use filenames that don't require quoting
when you set up your tests.
1970's style static test cases are not relevant h
On 5/3/24 04:09, Greg Wooledge wrote:
On Thu, May 02, 2024 at 10:18:03PM -0700, David Christensen wrote:
I am unable to find $'string' in the dash(1) man page (?). As I typically
write "#!/bin/sh" shell scripts, writing such to deal with file names
containing non-printing characters is going to
On 03/05/2024 11:31, jeremy ardley wrote:
My use case is very simple. Give an argument to a program that expects a
single filename/path.
Role of realpath in your workflow is not clear for me yet.
If you need to copy its result to clipboard then you may use xsel,
xclip, etc.
realpath --zero
In days of yore (Fri, 03 May 2024), jeremy ardley thus quoth:
>
> On 3/5/24 19:06, Greg Wooledge wrote:
> > I would suggest that if you need to use a debugger to track down a bug
> > in your program, you should use filenames that don't require quoting
> > when you set up your tests.
>
> 1970's s
On 3/5/24 19:06, Greg Wooledge wrote:
I would suggest that if you need to use a debugger to track down a bug
in your program, you should use filenames that don't require quoting
when you set up your tests.
1970's style static test cases are not relevant here.
In the real world... I download
On Thu, May 02, 2024 at 10:18:03PM -0700, David Christensen wrote:
> I am unable to find $'string' in the dash(1) man page (?). As I typically
> write "#!/bin/sh" shell scripts, writing such to deal with file names
> containing non-printing characters is going to baffle me.
Currently, $' quoting
On Fri, May 03, 2024 at 12:31:13PM +0800, jeremy ardley wrote:
> My use case is very simple. Give an argument to a program that expects a
> single filename/path.
Then you need to use "$1" with quotes when you reference it. Simple!
> If you give it an unquoted and unescaped filename it will break
On 5/2/24 19:56, Max Nikulin wrote:
On 03/05/2024 09:19, Greg Wooledge wrote:
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.
There are still specific cases when quoting is necessary, e.g. ssh
remote command
+1
On 5/2/24 19:19, Greg Wooledge wrote:
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 di
* 2024-05-03 06:59:37+0800, jeremy ardley wrote:
> I have a need to get the full path of a file that has spaces in its
> name to use as a program argument
> jeremy@client:~$ realpath name\ with\ spaces
> /home/jeremy/name with spaces
> Can realpath or other utility return a quoted pathname?
T
On 3/5/24 10:56, Max Nikulin wrote:
On 03/05/2024 09:19, Greg Wooledge wrote:
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.
There are still specific cases when quoting is necessary, e.g. ssh
remote command (howe
On 03/05/2024 09:19, Greg Wooledge wrote:
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.
There are still specific cases when quoting is necessary, e.g. ssh
remote command (however you have to be sure concerning shel
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 ne
On 5/2/24 15:59, jeremy ardley wrote:
I have a need to get the full path of a file that has spaces in its
name to use as a program argument
e.g.
jeremy@client:~$ ls -l name\ with\ spaces
-rw-r--r-- 1 jeremy jeremy 0 May 3 06:51 'name with spaces'
jeremy@client:~$ realpath name\ with\ spaces
On Fri, May 03, 2024 at 07:42:20AM +0800, jeremy ardley wrote:
>
> On 3/5/24 07:29, Greg Wooledge wrote:
> > > The spaces without quotes cause problems with subsequent processing.
> > Then the subsequent processing has bugs in it. Fix them.
> >
> > > Can realpath or other utility return a quoted
On 3/5/24 07:29, Greg Wooledge wrote:
The spaces without quotes cause problems with subsequent processing.
Then the subsequent processing has bugs in it. Fix them.
Can realpath or other utility return a quoted pathname?
That would be extremely counterproductive. Do not look for kludges to
On Fri, May 03, 2024 at 06:59:37AM +0800, jeremy ardley wrote:
> I have a need to get the full path of a file that has spaces in its name to
> use as a program argument
>
> e.g.
>
> jeremy@client:~$ ls -l name\ with\ spaces
> -rw-r--r-- 1 jeremy jeremy 0 May 3 06:51 'name with spaces'
> jeremy@
Am 03.05.2024 um 00:59 schrieb jeremy ardley:
> I have a need to get the full path of a file that has spaces in its
> name to use as a program argument
>
> e.g.
>
> jeremy@client:~$ ls -l name\ with\ spaces
> -rw-r--r-- 1 jeremy jeremy 0 May 3 06:51 'name with spaces'
> jeremy@client:~$ realpat
22 matches
Mail list logo