Prompt confirmation y/n to move a file...

I find that annoying in windows but at least you can disable it in UNIX. It's not as annoying when it's just a line in terminal.
This Posix sounds like an microsoft-attempt to unify and to make Unix (linux first) like windows.... systemd is an example of Redhat power to control Unix. Since Windows goes for Linux., Norms and standard can influence BSDs.

I would like to try on UNIX v.5.
Does anyone has Unix v.5. still running?

Can you try:

main(){ getchar(); }
compile,
and run it, and then copy with cp on this runnning executable.
I am looking forward to have results of it ;) that will be fun.

This is more than purism, it is actually physics.
Any systems can or could evolve to increase its size and complexity. It is called non-linear dynamical systems, and mathematical modelling is possible.
There is a minimal programming trend, which allows an operating system or a software to run at full speed and efficiently.
In other words, it is better to have 10 smaller programs in Unix, rather than using a single large one. It is better to keep small programs. There is a high probability that you will always return soon or later to use again the small, efficient, program.

Possible analogy, the less one has, the more control.

Consequently, the less popups, the more efficient BSD ;)
 
This Posix sounds like an microsoft-attempt to unify and to make Unix (linux first) like windows....
POSIX is older than Linux. It started in the late 1980s, when the Unix market was beginning to fragment into incompatible versions. Matter-of-fact, at that time Windows was a purely desktop operating system, and Microsoft also sold a version of Unix (it was called Xenix). If I remember right, Xenix for a while had the largest market share of all Unixes.

I would like to try on UNIX v.5.
Does anyone has Unix v.5. still running?
All Unix versions from AT&T Bell Labs (formerly also known as Western Electric and a few other names) are encumbered by an AT&T copyright. Furthermore, the original Bell Labs Unix versions only run on a PDP-11 (and I don't know which hardware models they support, not all PDPs are suitable, because they may have different memory layouts).

But fear not: Sometime in the late 90s or early 2000s, the then owner of the AT&T Unix copyright (probably SCO or Caldera or something like that) released the famous version 7 Unix, which was probably the pinnacle of a "workable" Unix version at Bell labs (stuff before was a bit too small and unstable, and afterwards the group focussed more on research topics than on usefulness and stability). I know that it is possible to find a legally runnable version of V7 Unix, which can be run on a PDP-11. Now, most likely, you don't have a PDP-11 (few people do), but there are emulators you can use on an x86 machine. I know that the folks at the Computer History Museum have quite a few V7 Unix machines running on emulators, just for fun.

Any systems can or could evolve to increase its size and complexity. It is called non-linear dynamical systems, and mathematical modelling is possible.
And now you have progressed into the realm of complete nonsense.

There is a minimal programming trend, which allows an operating system or a software to run at full speed and efficiently. In other words, it is better to have 10 smaller programs in Unix, rather than using a single large one.
As a general statement, this is patently untrue. The performance and efficiency of modern CPUs is dominated by memory interfaces, cache bandwidth, and instruction scheduling. For that you want tight inner loops, which use the (precious and small) L1 cache efficiently. This is difficult to achieve with many processes, many address spaces, and the resulting memory fragmentation.
 
This Posix sounds like an microsoft-attempt to unify and to make Unix (linux first) like windows.... systemd is an example of Redhat power to control Unix. Since Windows goes for Linux., Norms and standard can influence BSDs.

I would like to try on UNIX v.5.
Does anyone has Unix v.5. still running?

Can you try:

main(){ getchar(); }
compile,
and run it, and then copy with cp on this runnning executable.
I am looking forward to have results of it ;) that will be fun.

This is more than purism, it is actually physics.
Any systems can or could evolve to increase its size and complexity. It is called non-linear dynamical systems, and mathematical modelling is possible.
There is a minimal programming trend, which allows an operating system or a software to run at full speed and efficiently.
In other words, it is better to have 10 smaller programs in Unix, rather than using a single large one. It is better to keep small programs. There is a high probability that you will always return soon or later to use again the small, efficient, program.

Possible analogy, the less one has, the more control.

Consequently, the less popups, the more efficient BSD ;)

I don't understand. I tried another little C program and I was able to cp the file. :-/
 
It is. And this is getting ridiculous. If you think it isn't, describe exactly what you do (exact command typed) and how the outcome is not what I described above.

Just to make this as clear as possible:
  • mv will overwrite target without asking
  • mv -i will ask before overwriting
  • mv -i -f will overwrite without asking
This is *the same* behavior like rm and cp.
Though this Thread seems to have been started by trolling, this reply was very informative... :) I never knew this about mv, thanks good sir! :D
 
Ohhh. No I did it in freebsd. 😂
My mistake.
Originally, first K&R Unix could write on any files, using root access. Move mv files as well without thousand millions of popups.
I guess that this cp.c of Unix v6 differs very much from the cp.c of freebsd.
Actually, there is no protection coming from the bsd kernel while copying.

This unix v6 from above contributor is here (no override). This cp is slow, but it can copy well and sufficiently reliably (for experts only):

Feel free to give a try and experiment cp ;)
 
@Spartrekus Why dont you compile your own modified cp or mv command?
the source is there , I think there is in
Code:
/usr/src/bin/cp
instead of want to change the things globaly?
in some time I play with the cp source to change the order to display the name of the file that is copying BEFORE is finished to copy, is a litle detail but in Linux is like that
 
@Spartrekus Why dont you compile your own modified cp or mv command?
the source is there , I think there is in
Code:
/usr/src/bin/cp
instead of want to change the things globaly?
in some time I play with the cp source to change the order to display the name of the file that is copying BEFORE is finished to copy, is a litle detail but in Linux is like that

I am conscious about the necessity of FreeBSD to give high quality.
Therefore it would be wise to make widely the change cp / mv to remove the cp / mv limitations.
 
What popups? What hanging scripts? You mentioned that before but never showed a clear example how this is supposed to happen. So far you've only given a bunch of logical fallacies based on faulty assumptions.
 
the simple example:

Code:
mv dirent/ticalc /usr/local/bin/
override rwxr-xr-x  frodon/frodon for /usr/local/bin/ticalc? (y/n [n])
Command hangs, the team don't land on the moon...

What popups? What hanging scripts? You mentioned that before but never showed a clear example how this is supposed to happen. So far you've only given a bunch of logical fallacies based on faulty assumptions.

cp 13 ...
If you wanna have a flight to walk on the moon, you would like not to have failure.
That's a same with cp or mv.

I believe that this mv could be improved. what do you think?
 
Never mind. They will use Windows (or Linux) for the manned Jupiter mission.

And they will run out of licence when halfway. So the much more important question is: how do you run Paypal without a licence for the OS?
Funny joke.
If Microsoft or FreeBSD cannot copy or move a file without failure, then, Android will do it ! (joke)

Fortunately or unfortunately,... Nasa will not allow manned flights, powered by Microsoft Windows.
 
Fortunately or unfortunately,... Nasa will not allow manned flights, powered by Microsoft Windows.

What joke? Elon Musk will resettle to Mars in 2025, St.Peter's will be declared mosque in 2027, and I wanna be on the way to Jupiter by then.
 
Command hangs, the team don't land on the moon...
You explicitly configured an alias that added the -i option. If you set that option you should expect that question. If you don't want to get that question then don't set the option in the first place.

This is not a limitation or a failure. This is expected behavior. Your reasoning as to why things should be overwritten, or deleted, or whatever, is fine. But your examples simply don't show why this is a problem. Or why the option should be removed.
 
What joke? Elon Musk will resettle to Mars in 2025, St.Peter's will be declared mosque in 2027, and I wanna be on the way to Jupiter by then.

With a mv failure, you won't get your flight back to earth in any case:...

00:59:19,250 --> 00:59:22,187
We've gotta transfer all control
data over the LEM computer...

An alias is not reliable.
01:17:06,150 --> 01:17:08,069
Failure is not an option.
 
You shot yourself in your own foot, when you configured your system to have -i as the default. That was a bad idea. Don't do that. Once you do that, you can not expect scripts to continue working correctly.

Let me give you a more extreme example. There are lots of scripts in the base OS, as shipped, that rely on the programs ls, cp and mv to function "correctly", meaning exactly as documented. You have the freedom to reconfigure your system, and replace the ls, cp and mv binaries with a program like "fortune", which does nothing useful, and instead prints a (usually funny) message to stdout. After you do that, your computer will probably stop working, at the latest when it tries to boot again.

What you are demanding here is: "Make the computer safe to use. Make it so I can not do cat /usr/bin/fortune > /bin/cp. Because if I can do it, the space ship will not reach the moon". My answer to that is: If you want to use a computer to reach the moon, you need a reliable, and well-built system, and you need a reliable and intelligent user/administrator. Anyone who sets global default of "-i", or replaces important binaries with the fortune cookie program, should not be involved with the space program. (In reality, a high-reliability computer like the ones used for space flight would even have further safety measures, for example validating the checksums of installed software before liftoff.)

There are good reasons for things like the fact that you can use the ">" operator in the shell to write to files, for flags on commands, and for a file protection system that makes it so normal users can't modify system binaries or global system configuration, but root can. Which is why there is a required minimum level of competency for people who act as root.

Old joke: To administer a computer, you need to hire a man and a dog. The man is there to feed the dog. The dog is there to bite the man if he tries to touch the computer.
 
You explicitly configured an alias that added the -i option.
I don't think that's the case. By my understanding the confirmation question occurs when Spartrekus tries to mv a file over an executable when the latter is running. I confirm that, but still -f works.
Also, he mentioned that there is no confirmation in Linux in such cases. In general, that's not true: e.g. Debian for ARM (BBB) refuses such transactions at all (maybe because of filesystem in flash memory, not sure).
 
Still it doesn't matter, the semantics are very clear and consistent across many *nix systems, even if some details (when exactly -f is needed) might vary slightly from system to system. Bottom line is, if you want cp, mv and rm to execute the action no matter what (which might or might not be what you want in a script, depending on the usecase), you use -f. It's always been that way. A script using one of these commands without -f is either intended to fail on unexpected circumstances, or it is just buggy.
You shot yourself in your own foot, when you configured your system to have -i as the default. That was a bad idea. Don't do that.
I don't think so. A shell shouldn't expand aliases in scripts (and the shells I know don't), the aliases are for interactive use only. Setting aliases with -i is recommended in some places, as this flag is intended for interactive use. You might actually like it once it saved you from a typo, but after all, it's a personal decision :)

BTW, in a script, it's good practice to use absolute pathnames, so some weird /usr/local/bin/cp (however it ended up there) doesn't break your script.
 
Code:
mv dirent/ticalc /usr/local/bin/
override rwxr-xr-x frodon/frodon for /usr/local/bin/ticalc? (y/n [n])
I should have looked at the code right from the start. You only get that question if it's an interactive shell. If you use the -i option the question is slightly different.

It all happens between lines 204 and 221: https://svnweb.freebsd.org/base/stable/12/bin/mv/mv.c?revision=339434&view=markup

The 25 years worth of changes to mv.c fits on a single page: https://svnweb.freebsd.org/base/head/bin/mv/mv.c?view=log

The same logic has existed since the first commit (lines 133-185): https://svnweb.freebsd.org/base/head/bin/mv/mv.c?revision=1556&view=markup

Also, he mentioned that there is no confirmation in Linux in such cases. In general, that's not true: e.g. Debian for ARM (BBB) refuses such transactions at all (maybe because of filesystem in flash memory, not sure).
Not all Linux distributions are created equal. Not all of them use the GNU coreutils for cp, mv, etc. So there may be implementation differences between various Linux distributions.
 
I should have looked at the code right from the start. You only get that question if it's an interactive shell. If you use the -i option the question is slightly different.

It all happens between lines 204 and 221: https://svnweb.freebsd.org/base/stable/12/bin/mv/mv.c?revision=339434&view=markup

The 25 years worth of changes to mv.c fits on a single page: https://svnweb.freebsd.org/base/head/bin/mv/mv.c?view=log

The same logic has existed since the first commit (lines 133-185): https://svnweb.freebsd.org/base/head/bin/mv/mv.c?revision=1556&view=markup


Not all Linux distributions are created equal. Not all of them use the GNU coreutils for cp, mv, etc. So there may be implementation differences between various Linux distributions.

While not having a prompt, copying protection, while overwriting a document, being read by another process? That would be consistent with other commands (and foremost how Microsoft Windows works). Which makes these mv options not much coherent.

This is no point to have these protections, it is completely useless.
SirDice: Is there maybe something more Unix, i.e. Unix engineered by Bell lab/Gen. electr., than BSD (FreeBSD), without all those confirmation popups (needs to workaround -f and -i stuffs) for base binaries?
DragonflyBSD? I think that I will reinstall Plan9. It might be quite good alternative for making backups.

ed:
SirDice: btw, a tiny question, what does unzip into the base system (nothing installed)?
 
Back
Top