Mv or cp with a . (dot)?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mv or cp with a . (dot)?
# 15  
Old 12-01-2017
I do not think fear of change is closely related to age.

People are inherently afraid of changes.
Changes like jobs, partners, living space etc.
The IT is no different.

Problem nowadays is that a good programmer / engineer can cause a lot of former jobs redundant.

And in this wild capitalism company will not see those people as an asset, but as a money drain.
They will not re qualify / re educate those people to do something else.

Best example are self driving trucks and cars.
In about 5 to 10 years, self driving trucks will be common.
What will all those truckers do then ?
Most of them will not adapt and become a social burden.

Progress ? Yes!
But not all variables have been included or discussed at higher levels.
Not all people are meant to code or build machines.
I'm sure automation and robotics experts didn't have more poverty in mind when designing the next big thing.

Sorry for the philosophical rant!

Regards
Peasant.
These 4 Users Gave Thanks to Peasant For This Post:
# 16  
Old 12-01-2017
That's it.

I'll try that newer code. I'm sure it'll work great. Thanks again.

I find it funny that I know so little about simple coding like this and a lot of people think I'm some sort of genius. If only I had the knowledge you guys have - I could be even more frustrated! Knowing what can be done and then having to fight with people and their status quo is a mental battle for me. Do I try to convince them or do I leave them alone? I usually do things my way, keep it to myself, and after a while they hear about it and want to see what I've written and how it works, but almost no one is willingly open at first.

---------- Post updated at 09:21 PM ---------- Previous update was at 09:08 PM ----------

Oddly, what you're talking about with automation I agree with somewhat. The self driving cars will need someone to program them, someone to build them, someone to get them when they breakdown ... I've noticed that here in America everyone wants a fantastic job and that's who they are. In other countries people have a job and no matter what it is it's a job and they're proud to have A job at all. Most Americans, it seems, would rather accept free money from the government than work a job they don't think is worthy of their efforts.

I recently watched an episode of Anthony Bordain's Parts Unknown where there were dozens of people who's job it was to slowly turn a spit while a pig cooked. No automation. These people crouched down and slowly turned that handle, hour after hour. They had jobs!

We need to change our culture from, "free money is better than working", to "If you didn't work for your money you're the scum of the earth." Instead of people being embarrassed about a shitty job they should be embarrassed they don't have a job at all.
# 17  
Old 12-01-2017
Quote:
Originally Posted by Don Cragun
Even better... Now you can get rid of the find too:
Code:
for c in ../../bla/bla/*.xyz
do	cp "$c" ".${c##*/}"
done

If there aren't any matching files, you'lll get a diagnostic from cp saying something like:
Code:
cp: ../../bla/bla/*.xyz: No such file or directory

and a non-zero exit from your script.

P.S.: Note that (as mentioned before) this code won't copy hidden files.
Or the other way round, you are in the source dir and want to copy to the ../fa/la/ dir
Code:
for c in *.xyz
do
  cp "$c" "../fa/la/.$c"
done

# 18  
Old 12-01-2017
Quote:
Originally Posted by scribling
mv ./bla ../fa/la/.bla - doesn't work. I've tried all sorts of bracketing and that doesn't work.
There is nothing basically wrong with your command. See the transscript from my shell:

Code:
-1-2- ~/tmp > mkdir ../tmp/abcd
-0-2- ~/tmp > touch bla
-0-2- ~/tmp > mv ./bla ../tmp/abcd/.bla
-0-2- ~/tmp > ls -l ../tmp/abcd/.bla
-rw-r--r-- 1 fisrona Domain Users 0 Dec  1 08:26 ../tmp/abcd/.bla
-0-2- ~/tmp >

You say doesn't work without any additional information. I take it that you didn't get an error message from mv, otherwise you would have posted it. Now I have never encountered a case where mv would not work and at the same time does not write a message to stderr to explain why it failed.

I suggest that you reproduce the commands which I have posted on your machine and compare the output.
# 19  
Old 12-01-2017
I appreciate that I am coming to this thread very late and you seem to have some very qualified expert help here already. Therefore, I think this is likely to be my only post on this thread. However, I would like to contribute the following notes:

1. You are confusing filename and path. In /a/b/c/xyz, the/a/b/c is the path and xyz is the filename. The leading / means the path starts from the top of the system.

2. Without the leading / the path starts from the directory you are currently in, ie, there is a directory a pre-existing, with a b directory under that pre-existing, and a c directory under that pre-existing.

Quote:
Originally Posted by scribling
mv ./bla ../fa/la/.bla - doesn't work. I've tried all sorts of bracketing and that doesn't work.
I don't think you have told us all what OS you are using but it's unlikely that your (failing) 'mv' command is capable of creating the directories 'fa' and 'la' whilst moving the file. I think your destination path MUST pre-exist before you issue your 'mv' command.

I just wanted to make that point. That may, or may not, be your issue.

Last edited by rbatte1; 12-01-2017 at 09:59 AM..
# 20  
Old 12-01-2017
Wow, you're right. I completely wrote that command backward in the original post. It should have been mv ../fa/la/bla ./.bla

I got great feedback even though I completely screwed up the question.

Thank you everyone for the great info.

Last edited by rbatte1; 12-01-2017 at 10:00 AM.. Reason: Added CIODE tags
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List the file with a dot

I am on hp-ux and not able to catch the file with dot using a wild card. $ touch .test $ ls -l .test -rw-r--r-- 1 oracle dba 0 Mar 21 05:20 .test $ ls -l *test *test not found $ ls -la *test *test not found Why i am not able to list the file startign with .... (7 Replies)
Discussion started by: bang_dba
7 Replies

2. Shell Programming and Scripting

How to Removing a dot from a file name?

I need a script that will allow me to rename all of my files in subdir /FilesIn as follows: From kumc_835_111200.RMT.dat to kumc_835_111200RMT.dat kumc_835_111200.KMR.dat to kumc_835_111200KMR.dat .................etc How do I do that whithout doing a sed ... (10 Replies)
Discussion started by: mrn6430
10 Replies

3. Shell Programming and Scripting

removing DOT by using perl

Hi Friends, I have a variable which has a number (e.g. 12.1234). I want to remove "." (dot) from that number i.e. 121234 I want to do this using perl. Can you please guide me Thank you Anushree (2 Replies)
Discussion started by: anushree.a
2 Replies

4. Shell Programming and Scripting

Greping numbers with dot in it

Hi, I wanted to create a script what would take two numbers out of two files and add them together, but I got stuck with greping numbers what have a dot in it. So far I have grepped the two lines what include the numbers I need (from both files) to a third file and from that file I try to... (7 Replies)
Discussion started by: mario8eren
7 Replies

5. Shell Programming and Scripting

How to type a dot(.) instead of character?

Hi, I want to connect a Oracle databse through unix shell script. When I will execute a shell script it will ask for user name and password to connect the databsae. At the time of entering the password field value, it willl display the characters like star(*), dot(.) instead of exact... (2 Replies)
Discussion started by: rajesh08
2 Replies

6. UNIX for Dummies Questions & Answers

variable name with dot(.)

Hi, Is it possible to declare variable with name having dot(.) in it ? something like gs.test='HELLO' Thanks in advance :) (1 Reply)
Discussion started by: gopalss
1 Replies

7. Shell Programming and Scripting

Replacing dot for comma

I wanted to change 34.66 to 34,66. I tried the command: sed 's/./,/' $NUM Where $NUM is a variable with 34.66 value. The output is ,4.66 (2 Replies)
Discussion started by: bdalmeida
2 Replies

8. Shell Programming and Scripting

splitting on dot in perl

I am trying to split input that looks like ,2005-09-12 01:45:00.000000,2005-09-12 01:48:18.000000, I want to split on the dot . What I am using is ($ev_time,$rol)=split(/\./),$inputfile; This does not recognize the dot as what I want to split on. (2 Replies)
Discussion started by: reggiej
2 Replies

9. Shell Programming and Scripting

dot files

Hi, everyone. I'm now using rsync command, and please tell me what is the wildcard for below looks like. I want to chose dotfiles, such as .ipod .apple but i don't want to chose . and .. ------------------ .* doesn't work, of course. Thanks, Euler04 (2 Replies)
Discussion started by: Euler04
2 Replies
Login or Register to Ask a Question