Sponsored Content
Top Forums Shell Programming and Scripting Move file from one directory and update the list file once moved. Post 303013786 by RudiC on Wednesday 28th of February 2018 10:31:55 AM
Old 02-28-2018
We've already pointed out the pointlessness of the || [[ -n $line ]] construct - you might consider to get rid of it.

Does your mv version provide the -v option? Does your grep offer the -x option? Would, then, this come close to what you need?
Code:
while read line; do mv -v $line $target; done <file 2>/dev/null | sed 's/\o047\| ->.*$//g; s/^/^/'  | grep -vxf- file

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Move a file from windows directory to unix directory

Move a file from windows directory to unix directory, is this possible? if it is, can someone help me on this? Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies

2. Shell Programming and Scripting

List moved files in text file

Hi. I am actually doing all of this on OSX, but using unix apps and script. I have built my own transparent rsync/open directory/mobility/etc set of scripts for the firm I work at, and it is all almost complete except for ONE THING. I have the classic problem with rsync where if a user... (0 Replies)
Discussion started by: Ashtefere
0 Replies

3. Shell Programming and Scripting

A script that will move a file to a directory with the same name and then rename that file

Hello all. I am new to this forum (and somewhat new to UNIX / LINUX - I started using ubuntu 1 year ago).:b: I have the following problem that I have not been able to figure out how to take care of and I was wondering if anyone could help me out.:confused: I have all of my music stored in... (7 Replies)
Discussion started by: marcozd
7 Replies

4. Shell Programming and Scripting

Move the latest or older File from one directory to another Directory

I Need help for one requirement, I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix. Example: Source Directory : \a destination Directory : \a\b File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt) File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies

5. Shell Programming and Scripting

temporary file to file then move to directory

Ok in my bash script i have 5 options to create a simple html script. I need to create a temporary file and whatever the user types will be stored in that file using html codes. And then I have another option in which that temporary file will be moved to the public_html directory in which the user... (19 Replies)
Discussion started by: gangsta
19 Replies

6. Shell Programming and Scripting

How to create a log file that simply shows the name of a file and what directory it was moved to.

Newbie...Thank you for your help. I am creating my first script that simply generates subdirectories to organize video, music, and text files within those subdirectories from my current working directory. PROBLEM: I am trying to write a log file that contains, for each file, the original file... (0 Replies)
Discussion started by: BartleDoo
0 Replies

7. Shell Programming and Scripting

Shell script to get the latest file from the file list and move

Hi, Anybody help me to write a Shell Script Get the latest file from the file list based on created and then move to the target directory. Tried with the following script: got error. A=$(ls -1dt $(find "cveit/local_ftp/reflash-parts" -type f -daystart -mtime -$dateoffset) | head... (2 Replies)
Discussion started by: saravan_an
2 Replies

8. Shell Programming and Scripting

Move file in to directory- script

Hi In directory /mnt/upload I have about 100 000 files (*.png) that have been created during the last six months. Now I need to move them to right folders. eg: file created on 2014-10-10 move to directory /mnt/upload/20141010 file created on 2014-11-11 move to directory /mnt/upload/20141111... (6 Replies)
Discussion started by: primo102
6 Replies

9. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

10. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies
REARJ(1)							   Arj Software 							  REARJ(1)

NAME
rearj - Converts other archive formats to .arj files SYNOPSIS
rearj [options] <!listfile(s)|filespec(s)|wildname(s)> DESCRIPTION
The rearj command can repackage other archive formats to arj. OPTIONS
-+ Ignore REARJ_SW variable. -a[suffix] Convert archives within archives ("*" for all formats). -bcommand Execute command before extracting files. -ccommand Execute command on extracted files before counting them. -d Delete original archives. -e No error switch. -f Convert diskette archives. -g Skip creation of output archive. -i[name] Check integrity of rearj program. -j Skip if output archive size is larger than the original. -k Skip archive timestamping. -l[name] Write append log file (default name is rearj.log). -m[date] Select archives before date in YYMMDDHHMMSS format. -n[date] Select archives on or after date in YYMMDDHHMMSS format. -o Allow overwrite of existing target archive. -p Ignore long filenames under Windows 95. -q Query for each archive to convert. -r Recurse through subdirectories. -s Skip verify of file count and total size. -tsuffix Create suffix type archives. -u[bak] Allow update of archive with backup (default is BAK). -v Execute configured command on extracted files. -wdir Assign work directory. -x[!]file Exclude by filename, wildname, or listfile. -y[text] Delete output archive and write text to log (testing mode). -z Simulate operation. ENVIRONMENT
REARJ_SW If set, its value will be used as command line options. EXIT STATUS
0 Success. 1 File not found. 2 File is not a configured archive type. 3 Target archive already exists. 4 Not enough disk space. 5 User skipped or user did not select update option. 6 UNPACK command error. 7 PACK command error. 8 Target cannot support directories. 9 Wrong file count. 10 Wrong total size. 11 Internal archive REARJ error. 12 Rename archive error. 13 Invoked -v command error (found a virus?). 14 Output archive is larger. EXAMPLE
rearj * -r -d Convert all archives to ARJ format, searching all subdirectories, deleting original archives. SEE ALSO
arj(1). AUTHOR
This manual page was written by Ola Lundqvist <opal@debian.org> in pod format, then converted by Guillem Jover <guillem@debian.org> to nroff format. 3.10 2003-03-10 REARJ(1)
All times are GMT -4. The time now is 08:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy