Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] Delete files with condition Post 302649419 by Skrynesaver on Thursday 31st of May 2012 09:57:12 AM
Old 05-31-2012
I may have misunderstood your requirements, but what's wrong with this bash "one" liner:

Code:
for i in directory/with/videos/files/*.mp4;do if [ ! -e ${i%.mp4}.avi ] ; then rm $i;fi;done

Or more explicitly:
Code:
for i in directory/with/videos/files/*.mp4;do # work through all mp4 files
   if [ ! -e "${i%.mp4}.avi" ] ; then # if no matching avi file exists
      rm "$i" # delete the mp4 file
   fi
done


Last edited by Skrynesaver; 05-31-2012 at 01:00 PM.. Reason: Quoted filename variables in the light of Scrutinizer's very valid observation.
This User Gave Thanks to Skrynesaver For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

2. UNIX for Dummies Questions & Answers

[SOLVED] Delete files and folders under given directory

I have a requirement to delete the files and folders under a given directory. my directory structure is like this.. Data | A(Directory) |_PDF(Directory)----pdf files |_XML()Directory --xml files |--files | B(Directory) |_PDF(Directory)----pdf files |_XML()Directory --xml files ... (1 Reply)
Discussion started by: ramse8pc
1 Replies

3. Shell Programming and Scripting

[SOLVED] Sorting file and get everything on same line on condition

Good afternoon! I am a perl newbie. I hope you will be patient with me. I have a script that needs to be written in perl. I can't do it in awk or shell scripting. Here is the script: #!/usr/bin/perl use POSIX qw(strftime); use FileHandle; use Getopt::Long; use IO::Handle;... (0 Replies)
Discussion started by: brianjb
0 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Weird files to delete

Hi, I created some files with a script and I don't know yet where I did a mistake but the script created some "weird" files... prd01,/tmp # ls -al total 706184 -rw-r----- 1 root system 34 Aug 27 16:10 hdisk3BB hdisk3 hdisk3BB.tmp drwxrwxrwt 51 bin bin ... (9 Replies)
Discussion started by: Castelior
9 Replies

5. Shell Programming and Scripting

Delete if condition met in a column

i have a table like this: id, senderNumber, blacklist ----------------------------- 1 0835636326 Y 2 0373562343 Y 3 0273646833 Y and I want to delete automatically if a new inserted row on another table consist anything on senderNumber column above using a BASH Script I... (9 Replies)
Discussion started by: jazzyzha
9 Replies

6. Shell Programming and Scripting

[Solved] Get files & delete them by shell script

I want to use my script to get any file then delete it once it transfers to my side , I manage to create below script to generate "list" file which contains all file names in "10.10.1.1" then I made "a.out" file which contains the commands that I want to run it on "10.10.1.1" to get & delete the... (2 Replies)
Discussion started by: arm
2 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Delete files older than 10 years

I need a command which delete files older than 10 years. I got a command for 90 days and all commands I find are for days and nothing for years. find file_name -mtime +90 -exec rm {} \; (5 Replies)
Discussion started by: eskay
5 Replies

8. Shell Programming and Scripting

Delete File in a Directory Using a Condition

Hello, I have a directory with many files whose creation time is distributed all over the day. I need ANY 20 files per hour. So, I need 20 files for hour 00 20 files for hour 01 ... 20 files for hour 23 What I have done so far is not great. Here is the code: # get the Month a=`echo... (8 Replies)
Discussion started by: shekhar2010us
8 Replies

9. Shell Programming and Scripting

[Solved] How to stop script at certain condition?

Hi Gurus, my script likes below if ;then if ; then exit 30 fi if for loop do done I want to if condition1 is true, it exit the execution the script completely with error code 30. but right now it still exe for loop. I try to add below if ;then if ; then ... (3 Replies)
Discussion started by: ken6503
3 Replies

10. Shell Programming and Scripting

[Solved] Help with condition

I have below code, I am checking on one server where ppp.sh process not running it is perfectly fine, when i am checking the same script on another server where ppp.sh script is running, it is throwing error "too many arguments", how to avoid this. If i will check on server where process running it... (5 Replies)
Discussion started by: learnbash
5 Replies
yuvkineco(1)							MJPEG tools manual						      yuvkineco(1)

NAME
yuvkineco - revert 2-3 pulldown movie SYNOPSIS
yuvkineco [options] [-C PATH] yuvkineco [options] -O|N PATH DESCRIPTION
yuvkineco reverts to original non-interlaced frames, from NTSC video which was film sourced and 2-3 pulled down. Input fps code must be 4(29.97fps), output fps code can be selected from 1(23.97fps) to 4(29.97fps). If 2, 3 or 4 selected, duplicated frames remain but they are reverted to non-interlaced. If input was non-interlaced only remove duplicate frames. Interlaced frame detection may fail in conditions like: Pull down cycle changed (video editing). Low quality pull down. Motionless scene. If -C PATH was specified, yuvkineco outputs 2-3 pull down cycle list to the file. You can edit this file by hand and feed it to yuvkineco with -O or -N option to correct mistake of 1st yuvkineco. Try -C and see cycle list. EXAMPLE #1: for 24p movie / automatically lav2yuv 60i.eli | yuvkineco -F 1 | yuv2lav -f a -I 0 -o 24p.avi EXAMPLE #2: for 30p/24p mix / automatically lav2yuv 60i.eli | yuvkineco -F 4 | yuv2lav -f a -I 0 -o 30p.avi EXAMPLE #3: for 24p movie / check and repair lav2yuv 60i.eli | yuvkineco -F 1 -C 60i.23c | yuv2lav -f a -I 1 -o take1.avi glav -F +n take1.avi # check and edit 60i.23c lav2yuv take1.avi | yuvkineco -F 1 -N 60i.23c | yuv2lav -f a -I 0 -o take2.avi EXAMPLE #4: for 24p movie / check and retry lav2yuv 60i.eli | yuvkineco -F 1 -C 60i.23c | yuv2lav -f a -I 0 -o take1.avi glav -F +n take1.avi # check and edit 60i.23c lav2yuv 60i.eli | yuvkineco -F 1 -O 60i.23c | yuv2lav -f a -I 0 -o take2.avi OPTIONS
yuvkineco accepts the following options: -F FPSCODE Set output fps code (default: same as input). -C PATH Specify 2-3 pull down cycle list file name to write. -O PATH Specify cycle list name to read with old yuv stream to retry. -N PATH Specify cycle list name to read with new yuv stream to repair. -S MIN Use yuvycsnoise(1) as preprocessor and specify minimum threshold. -n LEVEL Specify noise level of input (default: 10). This affects both pulldown cycle detection and deinterlacing. -c THRESHOLD Specify threshold to decide pictures in 2 frames are same (default: 4). yuvkineco compares several frames, searches pair of frame they contain same pictures, to decide which frame should be dropped. If THRESHOLD is 0, pair which has smallest difference will be selected. If 16, selected from pairs those have differences smaller than average. -i PERMIL yuvkineco deinterlaces each frame after 2-3 pulldown reverting process, specify how much pixels deinterlaced to decide to use or not use deinterlacing result (default: 10). If PERMIL is 10 and 1% or more of pixels deinterlaced, deinterlacing result will be used. If 0, always deinterlacing result will be used. If 1000, deinterlacing result will not be used, but deinterlacing process will run on all of frames. To disable deinterlacing process, specify negative value. -u Set interlace information in header of output to unknown (default: non-interlaced). AUTHOR
yuvkineco was written by Kawamata/Hitoshi. If you have questions, remarks, problems or you just want to contact the developers, the main mailing list for the MJPEG-tools is: mjpeg-users@lists.sourceforge.net For more info, see our website at http://mjpeg.sourceforge.net/ SEE ALSO
mjpegtools(1), yuvycsnoise(1). MJPEG Linux Square 5 February 2002 yuvkineco(1)
All times are GMT -4. The time now is 02:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy