Maybe something a little faster and easier (i.e., no invocations of awk, basename, cut, find, or sort), like:
This was tested with both bash and ksh on macOS Mojave, version 10.14.3 and seems to do what you want with the two sample PDF files and the two sample directory names provided in this thread. The PDF files were copied to the expected directories.
This User Gave Thanks to Don Cragun For This Post:
Hi,
I have a requirement to move a file from one folder(a) to another folder(b) only when folder (b) have a write permission. Folder permission is 755
If the permission is otherthan 755 we need to come out of the loop
I will appreciate your help
Thanks
Soll (1 Reply)
This is the file structure:
DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg
DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg
DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg
DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg
DESKTOP/Root of Photo... (4 Replies)
Hello guys
I am sure that you will help me on this issue as you did earlier::)
Scenario :
I have a folder named "XYZ". It consist many sub-folders and subfolder contain severals files. there may be abc.dat in each subfolder. Now i want to seperate subfolders on follwing conditions-
if abc.dat... (12 Replies)
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)
Dear Experts,
I need to connect to a FTPS Server and move the files from FTPS folder "/SAP/Out" to Unix directory "/SAP/In". I need to run this script on Unix directory...Script should get the files from FTPS folder and place that in specified Unix Directory.
Thanks In Advance. (1 Reply)
Hi all,
let me explain my requirments
i am having 5 folder with different name for eg) abc , cdf , efd, rtg, ead
each 5 folders contain 15 files
i want to move 10 files to some other folder, remain 5 files should be there in the same folder.
give me some suggestion on this. (6 Replies)
Hi All,
I have directory and it has multiple sub directories and all these sub directories contains many files. i want to move all these files to one different directory. But after moving files i should be able to recognize which file belongs to which directory.
Is there any way to achieve... (6 Replies)
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)
Hi Team,
I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder.
Eg:
parent folder --> /Interface/data/test/IN
Sub folder -->/Interface/data/test/IN/Invoice20180607233338
Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies
LEARN ABOUT DEBIAN
fnext
NEW(1) [nmh-1.5] NEW(1)NAME
new - report on folders with new messages
fnext - set current folder to next folder with new messages
fprev - set current folder to previous folder with new messages
unseen - scan new messages in all folders with new messages
SYNOPSIS
new [sequences] [-mode mode] [-folders foldersfile] [-version] [-help]
fnext is equivalent to new -mode fnext
fprev is equivalent to new -mode fprev
unseen is equivalent to new -mode unseen
DESCRIPTION
New in its default mode produces a one-line-per-folder listing of all folders containing messages in the listed sequences or in the
sequences listed in the profile entry "Unseen-Sequence". Each line contains the folder, the number of messages in the desired sequences,
and the message lists from the .mh_sequences file. For example:
foo 11.* 40-50
bar 380. 760-772 824-828
total 391.
The `*' on foo indicates that it is the current folder. The last line shows the total number of messages in the desired sequences.
New crawls the folder hierarchy recursively to find all folders, and prints them in lexicographic order. Override this behavior by provid-
ing foldersfile containing the pre-sorted list of folders new should check, one per line.
In fnext and fprev modes, new instead changes to the next or previous matching folder, respectively.
In unseen mode, new executes scan sequences for each matching folder.
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
Path: To determine the user's nmh directory
Current-Folder: To find the default current folder
Unseen-Sequence: The name of the unseen message sequence
SEE ALSO scan(1), mh-format(5)HISTORY
Based on Luke Mewburn's new (http://www.mewburn.net/luke/src/new).
MH.6.8 11 June 2012 NEW(1)