Mv or cp with a . (dot)?

Login or Register for Dates, Times and to Reply

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mv or cp with a . (dot)?
# 15  
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!

These 4 Users Gave Thanks to Peasant For This Post:
# 16  
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  
Originally Posted by Don Cragun
Even better... Now you can get rid of the find too:
for c in ../../bla/bla/*.xyz
do	cp "$c" ".${c##*/}"

If there aren't any matching files, you'lll get a diagnostic from cp saying something like:
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
for c in *.xyz
  cp "$c" "../fa/la/.$c"

# 18  
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:

-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  
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.

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 10:59 AM..
# 20  
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 11:00 AM.. Reason: Added CIODE tags
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #596
Difficulty: Hard
For loops in C use the familiar syntax of placing the initialization, continuation condition, and interpretation on the same line as the keyword for.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create polygon around dot

Dear Masters, Kindly need your help to solve my issue.. My goal is create a polygon around "dot" (x,y coordinate) lets say we have some dot as below (these coordinates have meter as unit) 588237.20 5768355.50 588337.90 5768402.50 588459.70 5768436.00 588584.30 ... (7 Replies)
Discussion started by: ipatah
7 Replies

2. 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

3. Shell Programming and Scripting

use dot file in linux

Hi, I am creating a phonebook to store the name:phone:address.The phonebook is used to store, edit,delete and list the data. Now i need to use text file(dot files) for configuration (saving and loading selections). I really don't know how to do that. Please help thanks.. (6 Replies)
Discussion started by: coolgal
6 Replies

4. Shell Programming and Scripting

printing trailing dot

how to print a continuous trailing dot in output like ".........................." while a script is executing. Can anyone help... (23 Replies)
Discussion started by: proactiveaditya
23 Replies

5. 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

6. 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

7. 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

8. 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

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

Featured Tech Videos