Sponsored Content
Top Forums Shell Programming and Scripting How to deal with replaced files? Post 302784021 by gogok_bg on Thursday 21st of March 2013 10:06:24 AM
Old 03-21-2013
Quote:
Originally Posted by hanson44
It would help if you could compose a test case. Give a sample of eight or so file names with complete paths, and the final complete paths you want.

Of course it's possible to do most anything. But sometimes the cure is worse than the disease. Why do you want all the files in one directory? The whole point of having directories is to organize information. What would be the result if you took all the papers out of your file cabinet and emptied them onto your desk? Smilie Is there any chance you could use tar or zip to accomplish whatever you are trying to do?
Well actually the files i need to copy are files i was specifically looking for, and they have something in common, so getting them in the same directory wood not presan an issue.

Here is an example:

Code:
/media/gogo/6651-FEAB/Desktop/Desktop.jpg
/media/gogo/6651-FEAB/Desktop/fatgen103-1.pdf
/media/gogo/6651-FEAB/Desktop.jpg
/media/gogo/6651-FEAB/DOCS/docs slamka/ExpertizaShablon.doc
/media/gogo/6651-FEAB/DOCS/docs slamka/Pismo-Shablon.doc
/media/gogo/6651-FEAB/eks/blaaaak/backup/path/map.jpg
/media/gogo/6651-FEAB/DOCS/docs slamka/Pismo_Uvedomitelno-Shablon.doc
/media/gogo/6651-FEAB/DOCS/docs slamka/PrPedavane-Shablon.doc
/media/gogo/6651-FEAB/DOCS/docs slamka/експертиза.doc
/media/gogo/6651-FEAB/DOCS/doc/letter.doc
/media/gogo/6651-FEAB/linux/Best Practices v3_1.pdf
/media/gogo/6651-FEAB/linux
/media/gogo/6651-FEAB/linux/logo1.jpg
/media/gogo/6651-FEAB/linux/logo2.jpg
/media/gogo/6651-FEAB/priemo_predav protokol2.doc
/media/gogo/6651-FEAB/tragva/Snapshot-15.jpg
/media/gogo/6651-FEAB/files/leto/21661-Clipart-Picture-Illustration-Of-A-Collection-Of-10-Floral-Vines-And-Flourishes-In-Black-And-White.jpg

/media/gogo/6651-FEAB/експертизи/Other/Help/images/help_logo_top.png
/media/gogo/6651-FEAB/експертизи/eks/REGISTRI/Desktop.jpg
/media/gogo/6651-FEAB/eks/blaaak/Blanka Obekt 5 - HP.doc
/media/gogo/6651-FEAB/eks/blaaaak/Blanka Obekt DELL.doc
/media/gogo/6651-FEAB/eks/blaaaak/map.jpg

all this lines are in a file datafinal. Path to this file is:
Code:
/home/gogo/Desktop/datafinal

The files i will copy will be always from removable device, hard drive or flash, dunno if this is relevant.

Need the files here:
Code:
/home/gogo/Documents/filetumb

Do it anyway you can, all files in one directory with the files who have duplicated names put in a sub directory OR copy all files with they are path in the folder i pointed.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

what commands are used to deal with core files on linux redhat???

how do you cause a running pocess to dump a core file on linux systems?? i tried sleep 100 & kill -SEGV PID but nothing is created also, what commands can be used to analyze them? (extract useful info from them) (2 Replies)
Discussion started by: TRUEST
2 Replies

2. AIX

hdisk0 becomes hdisk2 after replaced

hello, I must've screwed something here.. I just had hdisk0 replaced by IBM.. now it shows up as hdisk2 instead. Before doing that, I've had it split from hdisk1, and reduced from rootvg. Just did a rmdev -dl hdisk2.. ran cfgmgr, but still shows up as hdisk2 instead of hdisk0.. help! (2 Replies)
Discussion started by: kiem
2 Replies

3. Programming

Can Mutex be replaced with anything?

Hi All, To avoid race condition, instead of using mutex, semaphore, spinlock etc.... Is there any other mechanism by which we can avoid race condition in an multi-threading environment. -Thanks (6 Replies)
Discussion started by: rvan
6 Replies

4. Shell Programming and Scripting

How to deal with .tar.gz files in Linux?x

Dear all, there are more than 10 files with .tar.gz extension in my folder i didnt want to extract them i just want to run the query to fetch my necessary data from all the files. but when i run the command it untar the files in that folder. gunzip -c abc.tar.gz | tar -xf - | grep REC |... (0 Replies)
Discussion started by: jojo123
0 Replies

5. Shell Programming and Scripting

comma replaced with pipe

Source data: "123","aaa bbb CCC","12000" "134","HHH,bbc","13000" i have a delimited file. i want to replace with the pipe.The sed command is not working for replacing a delimeter. Command : sed s/\,/\|/g filename Output : When i run the command it is replacing the columns value... (7 Replies)
Discussion started by: number10
7 Replies

6. Shell Programming and Scripting

awk next time replaced by none

Hi Everyone, 1.txt a b c d e f d g gg output: abc de (3 Replies)
Discussion started by: jimmy_y
3 Replies

7. Shell Programming and Scripting

Performing a calculation on string to be replaced

Hi, I have a file with occurances of the string "TO_DATE(<number here>,'J')" at random places. I need minus 2400000 from the number and replace the string with "convert(date, dateadd(dd, <new number here>,'16 Nov 1858')". I'm finding this difficult as the string isn't necessarily in the... (9 Replies)
Discussion started by: user_invalid
9 Replies

8. Shell Programming and Scripting

variable value is not getting replaced

Hi, I am trying to generate list of employees from emp table who joined yesterday. emp.sh YEST=$(date --date='1 day ago' +%Y-%m-%d) cat emp.sql | mysql -u <user> -p<pass> -h <host> -P <port> -D <dbname> > emp.csv emp.sql select * from employee where join_date = '$YEST'; I expected... (3 Replies)
Discussion started by: ravi.videla
3 Replies

9. UNIX for Dummies Questions & Answers

How to deal with incomplete image files

Sorry for the odd title, but I couldn't think of an easy way to describe my issue. Background I have a home security system that continually sends (via FTP) 4 different still images to a directory on my personal website - cam0.jpg, cam1.jpg, etc. I've written an extremely basic html script to... (4 Replies)
Discussion started by: CinciJeff
4 Replies

10. Shell Programming and Scripting

How to deal files with space in names?

I have a bash file as following: #!/bin/sh deal_file(){ printf $1 printf "\t is a file" echo } main(){ for file in `find "$1" ` do deal_file $file done } main $1 then I run ./t.sh .,get the following results: (1 Reply)
Discussion started by: 915086731
1 Replies
uucp(1c)																  uucp(1c)

Name
       uucp, uulog, uuname - unix to unix copy

Syntax
       uucp [option...] source-file...	destination-file

       uulog [option...]

       uuname [option...]

Description
       The  command  copies  files  named by the source-file arguments to the destination-file argument.  A file name either may be a path name on
       your machine or may have the form

	      system-name!pathname

       where `system-name' is taken from a list of system names which knows about.  Shell metacharacters ?*[] appearing in the pathname part  will
       be expanded on the appropriate system.

       Pathnames  may  be  a  full  pathname, a pathname preceded by ~user, where user is a userid on the specified system and is replaced by that
       user's login directory, or anything else prefixed by the current directory.

       If the result is an erroneous pathname for the remote system, the copy will fail.  If the destination-file is a directory, the last part of
       the  source-file  name is used.	If a simple ~user destination is inaccessible to data is copied to a spool directory and the user is noti-
       fied by

       The command preserves execute permissions across the transmission and gives 0666 read and write permissions.  For further information, see

Options
       The following options are interpreted by

       -d Creates all necessary directories for the file copy.

       -c Uses the source file when copying out rather than copying the file to the spool directory.

       -m Sends you mail when the copy is complete.

       -nrec
	  Sends mail to the recipient.

       -W Expands only local files.  Normally files names are prepended with the current working directory if a full path is not  specified.   The
	  -W tells to expand local files only.

       The command prints a summary of and transactions that were recorded in the file

       The options cause to print logging information:

       -ssys
	  Displays information about work involving specified system.

       -uuser
	  Displays information about work involving specified user.

       The command lists the uucp names of known systems.

       -l Lists local system name.

Warnings
       The  domain  of	remotely  accessible  files  can (and for obvious security reasons, usually should) be severely restricted.  You will very
       likely not be able to fetch files by pathname.  Ask a responsible person on the remote system to send them to you.  For the  same  reasons,
       you will probably not be able to send files to arbitrary pathnames.

Restrictions
       All files received by will be owned by uucp.
       The  -m	option	will  only work sending files or receiving a single file.  (Receiving multiple files specified by special shell characters
       ?*[] will not activate the -m option.)

Files
       /usr/spool/uucp - spool directory
       /usr/lib/uucp/* - other data and program files
       /etc/acucap - shared autodial modem database

See Also
       mail(1), uux(1c), acucap(5)
       "Uucp Implementation Description," ULTRIX Supplementary Documentation, Vol. III:System Manager

																	  uucp(1c)
All times are GMT -4. The time now is 09:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy