Re: [DNG] [OT] bash / quote weirdness

2022-01-14 Thread Steve Litt
Simon said on Thu, 13 Jan 2022 18:38:56 +

>Steve Litt  wrote:
>
>> This is one reason why, in shellscripts, you
>> need to quote almost all variables: So they act correctly with the
>> space laden filenames that windows dwoobydogs just love to create.  
>
>Not just Windows users. I regularly use spaces in file names.
>
>There’s an argument that computers should be tools, not slavemasters.
>I’m sure you’ll remember going back a few decades how interacting with
>computers meant that the human had to learn how to deal with the
>computer’s way of doing things. 

The preceding is true to a great extent. But not a total extent.
There's a tradeoff between user friendly and program simplicity. I
don't think substituting underscores for spaces **in filenames** is a
substantial inconvenience for the user.

[snip]

>Similarly with file names. Once upon a time the human had to adapt to
>what the computer supported - such as fitting your entire file name
>into 8 characters. 

But that kind of restriction isn't being discussed here. It's a
strawman.

> Now the computer (mostly) supports what is natural
>for a human - and that includes using spaces in their writing.
>After_all_it_does_seem_a_bit_un-natural_not_being_allowed_to_use_spaces_in_your_writing_-_it_would_make_a_hard_to_read_book_!

We're not talking about books. Or text files. Or anything except
filenames. Very_few_people_make_filenames_this_long, and if they do,
with a little practice it's pretty easy to use underscore instead of
space.

As long as we're strawmanning, let's go all the way. Instead of issuing
"file not found" when a filename isn't found, we can include an AI
module in every program that decides what the user *really* meant when
typing in the filename. It can analyze every filename on the computer,
perhaps look at its contents, and then decide which the user really
wanted, and open that one. Or, if the file is clicked from a file
manager type interface, the AI can analyze all similarly named files in
that directory and others, and issue an "Are you sure" with ranked
choices of other possibilities. 

My point is that sure a computer should be more of a tool than a
slavemaster, but it's a tradeoff, not an absolute. There's a spectrum.

Programming around every conceivable filename increases software
complexity. Let's not forget that simplicity and small attack surface
are assets.

One more thing: One person's "user friendly" is another person's "user
hostile". The "we do it all for you" interface aiding the person not
willing to bend at all to the machine is the "we get in your way"
interface for the person who wants to bend the machine to his/her
workflow. 

SteveT

Steve Litt 
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] [OT] bash / quote weirdness

2022-01-14 Thread Steve Litt
Olaf Meeuwissen said on Fri, 14 Jan 2022 18:40:40 +0900

>Hi,
>
>Steve Litt  writes:
>
>> [...] Here at Troubleshooters.Com, spaces and all punctuation except
>> underscore and hyphen are forbidden, but files coming in from the
>> outside have horrible filenames.  
>
>Pretty sure you allow periods too ;-P

Yes, I allow periods too. Forgot about that. But I try to use the
periods only to separate the filetype and try to have only one period
in the fileNAME.

SteveT

Steve Litt 
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] bash / quote weirdness

2022-01-14 Thread Steve Litt
Benjamin Riefenstahl said on Fri, 14 Jan 2022 10:33:29 +0100

>Hi Steve,
>
>> Benjamin Riefenstahl said on Thu, 13 Jan 2022 18:19:23 +0100  
>>>Different code paths within Bash.  [...]  
>
>Steve Litt writes:
>> This is true, but not the explanation for this particular behavior,
>> as follows:
>>
>> [slitt@mydesk ~]$ /usr/bin/cat -n /etc/fstab | cut -b 1-20 | head -n5
>>  1   UUID=730eaf92
>>  2   UUID=41abb5fd
>>  3   UUID=96cfdfb3
>>  4   UUID=6F66-BF7
>>  5   tmpfs /tmp tm
>> [slitt@mydesk ~]$ "/usr/bin/cat -n" /etc/fstab | cut -b 1-20 | head
>> -n5 bash: /usr/bin/cat -n: No such file or directory
>> [slitt@mydesk ~]$ "/usr/bin/cat -n /etc/fstab" | cut -b 1-20 | head
>> -n5 bash: /usr/bin/cat -n /etc/fstab: No such file or directory
>> [slitt@mydesk ~]$  
>
>I'm sorry, but I don't see it?  Can you point out what is suprising to
>you here?  Both commands contain "/", and both give the same error
>message.
>
>so long, benny

I thought you were saying that the cause of "cat -n" /etc/fstab being
seen as one command was due to cat not having a full path, so I put a
full path in front of it. If you weren't saying lack of a full path is
the cause of "cat -n" being considered a single command, then my
prepending the full path produces no surprise at all.


SteveT

Steve Litt 
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] [OT] Apple Mac programming (was: bash / quote weirdness)

2022-01-14 Thread Simon
Hendrik Boom  wrote:

>> I recall a lot of resistance when Apple brought out the Mac and suddenly 
>> programmers had to learn how to write programs that did what the user wanted 
>> - when the user wanted.
> 
> Sounds good.  But for the first two years the Mac was out, programmers 
> couldn't use it to write programs.  To program it you had to use a much moe 
> expensive machine, and Apple Lisa.
> 
> Not what I, a potential user, wanter.
> 
> After two years, somewone marketed a Pascal interpreter -- not even a 
> compiler.

Indeed, there were multiple issues at first - but programmers resistant to 
doing a bit of work so the user didn’t have to was one of them.
Back in 84 I was at Uni and took out out for a Test Drive and Apple was calling 
it back then - no intension or ability to actually buy one ! I do recall when I 
returned it and being asked what I thought, replying along the lines of “nice 
machine, pity they are trying to cripple it with s**t marketing” as the test 
drive program was (IMO) really horrible.

At work I have to use Windows laptops, and it’s a constant reminder of how 
Apple brought standardisation every time I try Ctrl-W and remember that in 
Outlook it’s Esc to close a window, or in IE Ctrl-W doesn’t work if it’s a PDF 
in the window. MS can’t even standardise basics within it’s own dross, so it’s 
no wonder no-one else bothers either.
We had the full set of Inside Mac back then - strange to think that the entire 
programming manuals (dead trees back then) were only about 3” thick back then ! 
But one of the 3 manuals was entirely dedicated to what the UI should look like 
and how it should work.

Was it Borland that did the Pascal first ?

Simon

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] request for assistance

2022-01-14 Thread o1bigtenor via Dng
Greetings

When I put this system together ( a LONG time ago) nvidia was not
quite the pariah it has become in the open source community. So I'm
stuck with nouveau for drivers (its a long explanation but trust me
I'm STUCK there!).

Nouveau is really not as wonderful as it purports to be and I would
love nothing better than to move to a Radeon solution except changing
the whole system for that is just a little cost prohibitive and then
newer gpus are mostly limited to at best 4 outputs and I have 5. Don't
really want to buy 2 cards either as that makes things just too bloody
expensive. So a new system is on hold until this one shows definite
signs of imminent demise or somebody drops a bunch of $$$ into my
pocket (fat chance of that!!).

So I have filed a bug report over at nouveau's system and they are
telling me to do something that I just can't find any information on
the web as a how to. Maybe someone here knows this area
(kernel/gpu/drm/whatever other software they're dragging in!) and
could advise.

I'm told to:

rebuild the kernel with CONFIG_NOUVEAU_DEBUG_PUSH=y

followed by:

boot the machine with drm.debug=0x16 log_bug_len=50m nouveau.debug=disp=trace

(the second command is maybe covered here:
https://www.howtoforge.com/tutorial/kernel-boot-parameter-edit/
but if there is a better/easier way please advise!!)

Is there anyone who can help?

(I really want to use that 4k monitor - - - I've been looking at it
for about 8 months now and when I connect it well - - - I get 2 to 16
hours of uptime and then its time to reboot - - - a royal pita()
at best)

TIA
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] [OT] bash / quote weirdness

2022-01-14 Thread Olaf Meeuwissen via Dng
Hi,

Steve Litt  writes:

> [...] Here at Troubleshooters.Com, spaces and all punctuation except
> underscore and hyphen are forbidden, but files coming in from the
> outside have horrible filenames.

Pretty sure you allow periods too ;-P
--
Olaf MeeuwissenFSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Softwarehttps://my.fsf.org/donate
 Join the Free Software Foundation  https://my.fsf.org/join
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] bash / quote weirdness

2022-01-14 Thread Olaf Meeuwissen via Dng
Hi,

Steve Litt  writes:

> Benjamin Riefenstahl said on Thu, 13 Jan 2022 18:19:23 +0100
>
>>Hi Steve,
>>
>>Steve Litt writes:
>>> [slitt@mydesk ~]$ "cat -n" /etc/fstab | cut -b 1-20 |  head -n5
>>> bash: cat -n: command not found
>>> [slitt@mydesk ~]$ "cat -n /etc/fstab" | cut -b 1-20 |  head -n5
>>> bash: cat -n /etc/fstab: No such file or directory
>>> [slitt@mydesk ~]$
>>
>>Different code paths within Bash.  When there is a "/" in the command
>>name, that is a file that has to exist by that exact name (the file
>>name can be relative, though).  When there is no "/", then and only
>>then the command is searched along $PATH, and if it is not found
>>there, the error message is different from the other case.
>
> This is true, but not the explanation for this particular behavior, as
> follows:
>
> [slitt@mydesk ~]$ /usr/bin/cat -n /etc/fstab | cut -b 1-20 | head -n5

Here your shell look for a file called "cat" i /usr/bin.

>  1UUID=730eaf92
>  2UUID=41abb5fd
>  3UUID=96cfdfb3
>  4UUID=6F66-BF7
>  5tmpfs /tmp tm
> [slitt@mydesk ~]$ "/usr/bin/cat -n" /etc/fstab | cut -b 1-20 | head -n5

Here your shell looks for a file called "cat -n" in /usr/bin.

> bash: /usr/bin/cat -n: No such file or directory
> [slitt@mydesk ~]$ "/usr/bin/cat -n /etc/fstab" | cut -b 1-20 | head -n5

Here your shell looks for a file called "fstab" in a directory called
"etc" in a directory called "cat -n " in /usr/bin.

> bash: /usr/bin/cat -n /etc/fstab: No such file or directory

Given that, I believe Benjamini's explanation still holds.

Hope this helps,
--
Olaf MeeuwissenFSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Softwarehttps://my.fsf.org/donate
 Join the Free Software Foundation  https://my.fsf.org/join
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] bash / quote weirdness

2022-01-14 Thread Benjamin Riefenstahl
Hi Steve,

> Benjamin Riefenstahl said on Thu, 13 Jan 2022 18:19:23 +0100
>>Different code paths within Bash.  [...]

Steve Litt writes:
> This is true, but not the explanation for this particular behavior, as
> follows:
>
> [slitt@mydesk ~]$ /usr/bin/cat -n /etc/fstab | cut -b 1-20 | head -n5
>  1UUID=730eaf92
>  2UUID=41abb5fd
>  3UUID=96cfdfb3
>  4UUID=6F66-BF7
>  5tmpfs /tmp tm
> [slitt@mydesk ~]$ "/usr/bin/cat -n" /etc/fstab | cut -b 1-20 | head -n5
> bash: /usr/bin/cat -n: No such file or directory
> [slitt@mydesk ~]$ "/usr/bin/cat -n /etc/fstab" | cut -b 1-20 | head -n5
> bash: /usr/bin/cat -n /etc/fstab: No such file or directory
> [slitt@mydesk ~]$

I'm sorry, but I don't see it?  Can you point out what is suprising to
you here?  Both commands contain "/", and both give the same error
message.

so long, benny
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] [OT] bash / quote weirdness

2022-01-14 Thread Alessandro Vesely via Dng

On Thu 13/Jan/2022 19:38:56 +0100 Simon wrote:


Similarly with file names. Once upon a time the human had to adapt to what the 
computer supported - such as fitting your entire file name into 8 characters. 
Now the computer (mostly) supports what is natural for a human - and that 
includes using spaces in their writing. 
After_all_it_does_seem_a_bit_un-natural_not_being_allowed_to_use_spaces_in_your_writing_-_it_would_make_a_hard_to_read_book_!



Indeed, early writings didn't use spaces, not even underscores, to separate 
words.  And they had no 'puters at the time.


Spaces in filenames may look friendlier than underscores, but they undergo a 
few annoying characteristics due to the fact that they cannot be seen.  You 
cannot distinguish them from tabs, or do you have a convention to not use tabs 
in file names?  And in that case may I ask why?  Oh, tabs do something else in 
a "save as..." form?  Well, spaces do something else when you use them on the 
command line.  They require quoting, which is annoying.


When used in URLs spaces become %20, which is not more readable than _.

For some reason, nobody use spaces in the local part of email addresses, 
although the syntax allows it.  People do so in order to be easier.


Please don't use spaces in the names of files that you share.

Best
Ale
--








___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng