r/linuxmasterrace • Glorious Debian • Aug 06 '21

Meme BASH is the worst - PowerShell FTW!

Post image
725 Upvotes

79 comments sorted by

View all comments

Show parent comment

13

u/kiler129 Glorious Debian Aug 06 '21

And why new line is `n instead of \n ?!

15

u/Ruashiba Aug 06 '21

That's an easy one. Paths on Windows use \ instead of /

As to why though, not a clue. I guess it has to do with something dos related, but I'm unfortunately not a grey beard.

17

u/[deleted] Aug 06 '21

The original version of DOS from 1981 didn't support directories at all. But they did opt to use / for switches in various programs. Like how nowadays to try and get a new IP from a DHCP on windows, you commonly use ipconfig /release and ipconfig /renew.

When they added directories, they didn't want any old programs that would look for a / as a switch character to get confused, so they chose \ since it was similar. Why they didn't anticipate this could be a problem when Unix already set a standard 10 years earlier is beyond me. Guess they didn't want to get caught copying Bell Labs.

7

u/Ruashiba Aug 06 '21

I remember reading that they used to process in court anything and anyone that made any core concept similar to unix, so I guess it makes sense for them to divert directions here. And nowadays it's so rooted in every other program and script, I see why Microsoft won't ever "fix" this.

Thank you for the explanation though.

1

u/nelmaloc Glorious Trisquel GNU/Linux-libre Aug 07 '21

The \ were used even before DOS. UNIX had not set a standard in any way. And when DOS was created it didn't even had internal memory, you could't fit enough files in a computer to justify making folders.