Page 2 of 7

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 7:27 pm
by SoulofDeity
gerryg400 wrote:
SoulofDeity wrote:Aside from confusion, one reason that I brought up the '/' root path was security. None of the UNIX tools question the actions of the root user, and when you don't make absolute paths explicit, you make it extremely easy to accidently destroy your filesystem by forgetting a single character.
The unix tools WILL question the user if the user wants them to. Just type "rm -i" if you feel you need to be queried. Additionally the root directory usually has its permissions set such that you cannot delete items from it. I really think you are imagining a problem where there actually isn't one.
I've heard people mention this before and imo, it is the most ignorant solution I've ever seen. It's like a kid sticking his finger in a hole so a dam doesn't leak. Just fix the friggin hole so the kid can go play. There should be no such thing as "if you feel you should be queried". Sooner or later, you're going to screw up, and when you do how you feel is going to be irrelevant. Skipping query should be explicit; like dos's "del /y"

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 7:33 pm
by gerryg400
SoulofDeity wrote:
gerryg400 wrote:
SoulofDeity wrote:Aside from confusion, one reason that I brought up the '/' root path was security. None of the UNIX tools question the actions of the root user, and when you don't make absolute paths explicit, you make it extremely easy to accidently destroy your filesystem by forgetting a single character.
The unix tools WILL question the user if the user wants them to. Just type "rm -i" if you feel you need to be queried. Additionally the root directory usually has its permissions set such that you cannot delete items from it. I really think you are imagining a problem where there actually isn't one.
I've heard people mention this before and imo, it is the most ignorant solution I've ever seen. It's like a kid sticking his finger in a hole so a dam doesn't leak. Just fix the friggin hole so the kid can go play.
Wait, you said the problem was that none of the tools question the action of the root user. I was just pointing out that at least one of them will. In my experience many sysadmins alias rm to rm -i. If that is not the problem, what is the real problem that you are trying to solve ?

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 7:34 pm
by SoulofDeity
gerryg400 wrote:Wait, you said the problem was that none of the tools question the action of the root user. I was just pointing out that at least one of them will. If that is not the problem, what is the real problem that you are trying to solve ?
There should be no such thing as "if you feel you should be queried". Sooner or later, you're going to screw up, and when you do how you feel is going to be irrelevant. Skipping query should be explicit; like dos's "del /y"

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 7:53 pm
by gerryg400
SoulofDeity wrote:
gerryg400 wrote:Wait, you said the problem was that none of the tools question the action of the root user. I was just pointing out that at least one of them will. If that is not the problem, what is the real problem that you are trying to solve ?
There should be no such thing as "if you feel you should be queried". Sooner or later, you're going to screw up, and when you do how you feel is going to be irrelevant. Skipping query should be explicit; like dos's "del /y"
I think this is a matter of taste. Unix tends to take the line operations should be performed without interacting with the user as a default. This is a feature that helps make unix good for scripting and DOS and Windows poor for that purpose. As I said rm is often aliased to rm -i in user's profiles. Scripts can run as usual and the user gets a prompt if he wants.

BTW, I've never heard of del /y in Dos . I believe that del /p will cause a prompt much like Unix. Additionally I believe that some windows commands become non-interactive when executed from scripts. That's sort of inconsistency is just plain weird.

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 8:06 pm
by SoulofDeity
gerryg400 wrote:Additionally I believe that some windows commands become non-interactive when executed from scripts. That's sort of inconsistency is just plain weird.
The difference from Unix is that all DOS commands are interactive by default and can be explicitly automated. The only thing that changes when using batch scripts is that variables use %% instead of % for prefixes and you can enable variable expansion (which allows you to modify variables that you are conditionally checking against in if statements and loops) It usually only takes a split second for a person to realize they screwed up. It overlaps with the time you release you finger from the return key and look at the terminal before you enter a hysteric and panicked state to smash Ctrl-C in the milliseconds it takes for the file to disappear.

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 8:18 pm
by gerryg400
SoulofDeity wrote:
gerryg400 wrote:Additionally I believe that some windows commands become non-interactive when executed from scripts. That's sort of inconsistency is just plain weird.
The difference from Unix is that all DOS commands are interactive by default and can be explicitly automated. The only thing that changes when using batch scripts is that variables use %% instead of % for prefixes and you can enable variable expansion (which allows you to modify variables that you are conditionally checking against in if statements and loops) It usually only takes a split second for a person to realize they screwed up. It overlaps with the time you release you finger from the return key and look at the terminal before you enter a hysteric and panicked state to smash Ctrl-C in the milliseconds it takes for the file to disappear.
Are you quite sure ? del deletes files without prompting in the cmd shell on a Windows 7 machine I just tried. What does the Windows/Doc standard say about this ?

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 8:24 pm
by SoulofDeity
gerryg400 wrote:Are you quite sure ? del deletes files without prompting in the cmd shell on a Windows 7 machine I just tried. What does the Windows/Doc standard say about this ?
I'd say that you're either lying or there's a registry key changing the behavior. Most likely the later. DOS was extremely configurable. You can even change the character used for switches from '/' to something else.

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 8:34 pm
by gerryg400
SoulofDeity wrote:
gerryg400 wrote:Are you quite sure ? del deletes files without prompting in the cmd shell on a Windows 7 machine I just tried. What does the Windows/Doc standard say about this ?
I'd say that you're either lying or there's a registry key changing the behavior. Most likely the later. DOS was extremely configurable. You can even change the character used for switches from '/' to something else.
I'm sure if you check you'll find a third option (i.e. that del removes files without asking and only asks for directories). In this respect it's no better or worse than Unix rm which also deletes files without asking but doesn't delete directories unless a special option is provided.

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 8:40 pm
by SoulofDeity
gerryg400 wrote:I'm sure if you check you'll find a third option (i.e. that del removes files without asking and only asks for directories). In this respect it's no better or worse than Unix rm which also deletes files without asking but doesn't delete directories unless a special option is provided.
I've used DOS / Command Line since Windows 95 and in my experience the 'del' command has always asked me for permission unless I explicitly told it otherwise. Deltree even asks when deleting each file in a directory.

I've been strictly using Unix-based OS's for about a year and a half or 2 years, but I don't think my memory is that rusty.


From here,
DEL / ERASE
No contents entries on this page
Contents

Comments
Purpose: Erase one file, a group of files, or entire subdirectories


Format: DEL [ranges] [/A:[[-|+]rhsadecijopt /E /F /I"text" /K /L /N[defjnst] /O:[-]adegnrstu /P /Q /R /S[[+]n] /T /W[n] /X /Y /Z] [@file] file...


file The file, subdirectory, or list of files or subdirectories to erase.
@file A text file containing the names of the files to delete, one per line (see @file lists for details).



/A: (Attribute select)


/P(rompt)

/B (Delete after reboot)


/Q(uiet)

/E (No error messages)


/R(ecycle bin)

/F(orce delete)


/S(ubdirectories)

/I (match descriptions)


/T(otal)

/K (no Recycle Bin)


/W(ipe)

/L (delete symlinks)


/X (remove empty subdirectories)

/N (Disable)


/Y(es to all prompts)

/O:... (Order)


/Z(ap hidden and read-only files)


/Y The reverse of /P . It assumes a Y response to everything, including deleting an entire subdirectory tree. TCC normally prompts before deleting files when the name consists only of wildcards or a subdirectory name (see above); /Y overrides this protection and should be used with extreme caution!

The online documentation for the command line is almost always out of date from what I recall. I learned how to use it by reading the stuff output by '/?', trial, and error. You're right that /y wasn't originally a switch, but it was latter added to mirror deltree that did have it.

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 8:51 pm
by gerryg400
SoulofDeity wrote:
gerryg400 wrote:I'm sure if you check you'll find a third option (i.e. that del removes files without asking and only asks for directories). In this respect it's no better or worse than Unix rm which also deletes files without asking but doesn't delete directories unless a special option is provided.
I've used DOS / Command Line since Windows 95 and in my experience the 'del' command has always asked me for permission unless I explicitly told it otherwise. Deltree even asks when deleting each file in a directory.

I been strictly using Unix for about a year and a half or 2 years, but I don't think my memory is that rusty.
Ah, I see what happened. Your del command was probably aliased to deltree which does indeed behave as you expected. Again I will say this is precisely what Unix people do. This is del for XP but it's been like this since Dos 2. https://www.microsoft.com/resources/doc ... x?mfr=true

Anyway we are off-topic now.

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 8:58 pm
by SoulofDeity
gerryg400 wrote:Ah, I see what happened. Your del command was probably aliased to deltree which does indeed behave as you expected. Again I will say this is precisely what Unix people do. This is del for XP but it's been like this since Dos 2. https://www.microsoft.com/resources/doc ... x?mfr=true

Anyway we are off-topic now.
Perhaps, but as I editted in before I was ninja'd, the online documentation for the command line is way out of date from what I recall. The only way to see all of the options is to use the '/?' switch. That's how I learned to use everything.

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 9:19 pm
by gerryg400
SoulofDeity wrote:
gerryg400 wrote:Ah, I see what happened. Your del command was probably aliased to deltree which does indeed behave as you expected. Again I will say this is precisely what Unix people do. This is del for XP but it's been like this since Dos 2. https://www.microsoft.com/resources/doc ... x?mfr=true

Anyway we are off-topic now.
Perhaps, but as I editted in before I was ninja'd, the online documentation for the command line is way out of date from what I recall. The only way to see all of the options is to use the '/?' switch. That's how I learned to use everything.
Here of course we see the advantage of the UNIX Standards. They are standard. You can learn things and they don't change. If you walk the well warn path there are no problems with the UNIX standard that have not been seen by others and which don't already have several solutions.

Forgive me for exaggerating here to make my point.

Re: Problems With UNIX Standards

Posted: Tue Feb 10, 2015 10:44 pm
by SoulofDeity
Well, back on topic, I just had an idea. I think the use of a single hosts file should be replaced with a database of multiple hosts files. The tradional hosts file is just a DNS ip cache for the www. The www is merely a service, and the internet can be used without it. What I'm thinking of is a peer to peer network. Just like in the past with DNS providers, there could be 'supernodes' in the network that have static ip's which they make available through books, advertisement, or even on the www. The users connect to a supernode which would update a list of other nodes and supernodes to form a list of peers. The peers would then exchange host information to resolve names. New domain names would be registered for free in a similar way to how bitcoin works; a race to see who is accepted by the most peers. This setup could also take advantage of torrents. Sites with more traffic would load faster than others in most cases.

Re: Problems With UNIX Standards

Posted: Wed Feb 11, 2015 3:09 am
by iansjack
SoulofDeity wrote:Well, back on topic, I just had an idea. I think the use of a single hosts file should be replaced with a database of multiple hosts files. The tradional hosts file is just a DNS ip cache for the www. The www is merely a service, and the internet can be used without it. What I'm thinking of is a peer to peer network. Just like in the past with DNS providers, there could be 'supernodes' in the network that have static ip's which they make available through books, advertisement, or even on the www. The users connect to a supernode which would update a list of other nodes and supernodes to form a list of peers. The peers would then exchange host information to resolve names. New domain names would be registered for free in a similar way to how bitcoin works; a race to see who is accepted by the most peers. This setup could also take advantage of torrents. Sites with more traffic would load faster than others in most cases.
You really are determined to screw things up that currently work perfectly well, aren't you? :)
The traditional hosts file is just a DNS ip cache for the www.
WTF is that supposed to mean? The hosts file existed long before the WWW and long before DNS; it is nothing to do with the WWW. It is becoming increasingly clear to me that you have little understanding of the philosophy behind Unix, which can basically be summed up as KISS, and are pretty shakey about some of the fundamentals. What do you think that DNS is all about other than that gobbledygook about "supernodes"?

By all means write your own OS with your own set of standards, but let's keep the tried and tested Unix standards clear of fiddling just for the sake of it.

Re: Problems With UNIX Standards

Posted: Wed Feb 11, 2015 5:05 am
by Icee
SoulofDeity wrote:That's how I learned to use everything.
It's a good thing to be self-reliant about your knowledge. If your knowledge is actually correct, that is.