Sponsored Content
Top Forums Shell Programming and Scripting Mv series out of mixed folder & identify substring Post 302889632 by Zack on Saturday 22nd of February 2014 01:33:28 PM
Old 02-22-2014
Mv series out of mixed folder & identify substring

Dear unix-Community,

great to be here!
Actually i try to build a script to sort out my serials into an series-folder.
Reason is: plex cant handle mixed folder filled with other stuff than series only.

First shot was ls in combination with grep and regex.
Got no positiv result.

Then i used find:
Code:
find . -maxdepth 1 -regex '.*[sS][0-9][0-9][eE][0-9][0-9].*'

works fine. But im wondering why this won't work:
Code:
find . -maxdepth 1 -regex '.*[sS]\d{2}[eExX]\d{2}.*'

Ok - Now it would be great to create a new folder named with the titel of the serial. but it's a bit difficult to get the name as substring before the SxxExx-Part (or including the Sxx one).
Code:
find $1 -maxdepth 1 -regex '.*[sS][0-9][0-9][eE][0-9][0-9].*' -exec basename {} \; | while read FILE
do
  #mkdir SerialTitel.S01
  #mv $FILE ../sorted/SerialTitel.S01/
  # #instead of:
  mv $FILE ../sorted/
done

Im happy about some ideas. I'll keep you up to date of my progress.

Good Weekend
Zack
 

9 More Discussions You Might Find Interesting

1. Solaris

Solaris & Hitachi identify

Hello, Is there anyway to tell which set of Hitachi array the disks belong to? I'm remotely located so I cannot do the physical check. The possible Hitachi arrays are: AMS1000 and 9570 This is what I see on the format: 2. c2t50060E800475EA02d1 <HITACHI-OPEN-V*9-SUN-5007 cyl 65533 alt 2... (0 Replies)
Discussion started by: kiem
0 Replies

2. Red Hat

SAMBA & Public Folder

Hello folks, I am trying to accomplish the following: 1. Create home folders for each user 2. Create a public folder where all users can access 3. Use Samba as a domain controller. I have successfully completed issue 1. But I can't get the second issue to work. Below is my config file.... (0 Replies)
Discussion started by: behradb
0 Replies

3. Shell Programming and Scripting

Script to identify logged users & commands executed

Hi All, I am trying to write a script to get the user information & the command executed. I tried something like this : w | sort | awk '{print$5$6$7}' My requirement is to identify the users who execute the same command at same time. I need the user name & the... (2 Replies)
Discussion started by: vijayarajvp
2 Replies

4. AIX

IBM AIX on IBM Eseries & x series server

Hi, I want to know whether IBM AIX can be installed on the IBM e series and x series server hardware? Thanks & Regards Arun (2 Replies)
Discussion started by: Arun.Kakarla
2 Replies

5. Shell Programming and Scripting

Help with parsing mailbox folder list (identify similar folders)

List sample: user/xxx/Archives/2010 user/xxx/BLARG user/xxx/BlArG user/xxx/Burton user/xxx/DAY user/yyy/Trainees/Nutrition interns user/yyy/Trainees/Primary Care user/yyy/Trainees/Psychiatric NP interns user/yyy/Trainees/Psychiatric residents user/yyy/Trainees/Psychology... (4 Replies)
Discussion started by: spacegoose
4 Replies

6. Shell Programming and Scripting

Script to Identify if folder has a file in it

Hi everyone I am new to the forums. I haven't done much linux myself but I have been asked if I can do the following. Write a linux script that needs to scan a certain folder every x amount of minutes and if there is a file in the folder then it needs to call a different script. Is this... (2 Replies)
Discussion started by: Bosbaba
2 Replies

7. Shell Programming and Scripting

Advanced AWK Regexp substring to int & Replace

Hi! I have a difficult problem, to step up a unknown version number in a text file, and save the file. It would be great to run script.sh and the version gets increased. Example the content of the textfile.txt hello version = x bye This include three steps 1. First find the char after... (2 Replies)
Discussion started by: Beachboy72
2 Replies

8. Red Hat

Identify the folder is part of which mount point

Dear, I am using Redhat 6.6 . How to identify a given directory is part of which mount point. (2 Replies)
Discussion started by: aneesha
2 Replies

9. Shell Programming and Scripting

Find all pdf an get make a folder from filename substring

Hi , i need your advice. i will find all *.pdf files and make a folder for every different prefix of file names. for example: test_21424234.pdf new_242342.pdf at the and i will that i create ( if not exits ) a new folder "test" and "new" , afterwards i will move the file in this new... (3 Replies)
Discussion started by: Maxwill
3 Replies
RMF(1)								     [nmh-1.5]								    RMF(1)

NAME
rmf - remove an nmh folder SYNOPSIS
rmf [+folder] [-interactive | -nointeractive] [-version] [-help] DESCRIPTION
Rmf removes all of the messages (files) within the specified (or default) folder, and then removes the folder (directory) itself. If there are any files within the folder which are not a part of nmh, they will not be removed, and an error will be produced. If the folder is given explicitly or the -nointeractive option is given, then the folder will be removed without confirmation. Otherwise, the user will be asked for confirmation. If rmf can't find the current folder, for some reason, the folder to be removed defaults to `+inbox' (unless overridden by user's profile entry "Inbox") with confirmation. If the folder being removed is a subfolder, the parent folder will become the new current folder, and rmf will produce a message telling the user this has happened. This provides an easy mechanism for selecting a set of messages, operating on the list, then removing the list and returning to the current folder from which the list was extracted. If rmf s used on a read-only folder, it will delete all the (private) sequences (i.e., "atr-seq-folder" entries) for this folder from your context without affecting the folder itself. Rmf irreversibly deletes messages that don't have other links, so use it with caution. 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 Inbox: To find the default inbox SEE ALSO
rmm(1) DEFAULTS
`+folder' defaults to the current folder, usually with confirmation `-interactive' if +folder' not given, `-nointeractive' otherwise CONTEXT
Rmf will set the current folder to the parent folder if a subfolder is removed; or if the current folder is removed, it will make "inbox" current. Otherwise, it doesn't change the current folder or message. BUGS
Although intuitively one would suspect that rmf works recursively, it does not. Hence if you have a sub-folder within a folder, in order to rmf the parent, you must first rmf each of the children. MH.6.8 11 June 2012 RMF(1)
All times are GMT -4. The time now is 06:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy