Re: [PLUG] a question on "mv" command

2017-10-04 Thread VY
thanks for all the reply. I hate code with side-effects too. Hence, I could not tell what "mv *" would do. but it was a discussion with a co-worker and he likes this kind of tricks. :) On Wed, Oct 4, 2017 at 7:16 AM, Paul Heinlein wrote: > On Tue, 3 Oct 2017, VY wrote: > > Thanks again for al

Re: [PLUG] a question on "mv" command

2017-10-04 Thread Paul Heinlein
On Tue, 3 Oct 2017, VY wrote: Thanks again for all the replies. I have a further question on this. Is doing "mv *" considered "bad coding"? In general, no matter which language I do, I try to avoid any side-effect. It's certainly nothing I would do on purpose. :-) For instance, here are t

Re: [PLUG] a question on "mv" command

2017-10-03 Thread wes
On Tue, Oct 3, 2017 at 8:20 PM, VY wrote: > Thanks again for all the replies. > > I have a further question on this. > > Is doing "mv *" considered "bad coding"? > > In general, no matter which language I do, I try to avoid any side-effect. > > It reduces readability in the code. Hard to debug

Re: [PLUG] a question on "mv" command

2017-10-03 Thread Ali Corbin
On Tue, Oct 3, 2017 at 8:20 PM, VY wrote: > Thanks again for all the replies. > > I have a further question on this. > > Is doing "mv *" considered "bad coding"? > In a word, yes. ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/

Re: [PLUG] a question on "mv" command

2017-10-03 Thread VY
Thanks again for all the replies. I have a further question on this. Is doing "mv *" considered "bad coding"? In general, no matter which language I do, I try to avoid any side-effect. It reduces readability in the code. Hard to debug when you have pages after pages of code that consists of a

Re: [PLUG] a question on "mv" command

2017-10-03 Thread Pete Lancashire
Use to be a good 'test' for a Comp Sci class. Before the class touch a b c mkdir d In the class mv * On Tue, Oct 3, 2017 at 9:25 AM, VY wrote: > Thanks for all the replies. I completely forgotten about "*" being > interpreted by the shell. > That makes sense now... > > thanks again! > > >

Re: [PLUG] a question on "mv" command

2017-10-03 Thread VY
Thanks for all the replies. I completely forgotten about "*" being interpreted by the shell. That makes sense now... thanks again! On Tue, Oct 3, 2017 at 9:16 AM, John Meissen wrote: > The 'mv' command takes the last argument as the destination. The shell will > expand the wildcard into a list

Re: [PLUG] a question on "mv" command

2017-10-03 Thread John Meissen
The 'mv' command takes the last argument as the destination. The shell will expand the wildcard into a list before calling 'mv' (or performing it, as I think it's actually built-in), so in your example mv * is equivalent to mv a b c > Dear All > > Yesterday, I was told of this usage of "mv

Re: [PLUG] a question on "mv" command

2017-10-03 Thread Paul Heinlein
On Tue, 3 Oct 2017, VY wrote: Dear All Yesterday, I was told of this usage of "mv" and I could not figure out why it would work. So I am sending out my question Say I am in a directory with 3 sub-directories "a", "b" and "c". I then type bash> mv * Directory "a" and "b" would move und

[PLUG] a question on "mv" command

2017-10-03 Thread VY
Dear All Yesterday, I was told of this usage of "mv" and I could not figure out why it would work. So I am sending out my question Say I am in a directory with 3 sub-directories "a", "b" and "c". I then type bash> mv * Directory "a" and "b" would move under "c". I re-read the man page fo