Sponsored Content
Top Forums Shell Programming and Scripting Code to remove files when corresponding file doesnt exist isnt working. Post 302590367 by archimedes on Monday 16th of January 2012 02:31:49 AM
Old 01-16-2012
hi.. here is another solution..

Code:
for file in `ls -1 *.transcript`
do
 name=`basename $file ".transcript"`".wav"
 if [ -f ${file} -a ! -f ${name} ]
 then
  rm -f $file
 fi
done

Regards,
A!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why passwd isnt working in shell scripts?

I had to write a script to change my login password, and the script wasnt working fine. When I searched through the previous postings in this forum, I got the solution (using 'expect' tool). But I would like to know why passwd command isnt working in scripts? (1 Reply)
Discussion started by: Deepa
1 Replies

2. Red Hat

trying to use arp command... it doesnt exist

im trying to get an ARP readout using the command 'arp -a'... but the command doesnt exist in Fedora Core 6 - IPv6.... is there an equivalent command? (4 Replies)
Discussion started by: HMSS013
4 Replies

3. Shell Programming and Scripting

why isnt cron working?

I am using Ubuntu linux desktop, and I am trying to schedule a sheel script to run every 10minutes. These are the steps I have taken: crontab -e added and saved this line to the file # m h dom mon dow command */1 * * * * /home/enzo/Desktop/dlrecentuse restarted cron: sudo... (5 Replies)
Discussion started by: daydreamer
5 Replies

4. Shell Programming and Scripting

If doc file exist remove

I need help running a script. I have the script looking into a folder and converting .doc files to .odt. The script works fine except that I want it to only run when .doc files are present. If I can do this then I can put .xls files and .ppt files in the folder and convert them when they are... (2 Replies)
Discussion started by: handband2
2 Replies

5. Shell Programming and Scripting

Check file and if it doesnt exist , exit script

Hi, Another problem, here is my code #!/bin/sh dir='/opt/apps/script/CSV' datadir='/opt/apps/script/data' while : ; do ls -1rt $dir/*.csv > /dev/null 2>&1 if ;then cp $datadir/weekly.txt $dir/weekly.csv else exit 0 fi done (10 Replies)
Discussion started by: tententen
10 Replies

6. UNIX for Dummies Questions & Answers

Cleanup job to remove old files suddenly not working

Hi I have a job that has been running for a while with the following statement to cleanup a directory: find /dbmgtu01/app/myplace/log ! \( -name "dc*" -o -name "sc*" -o -name "ms*" \) -type f -mtime +30 -print -exec rm {} \ ; The directory was recently changed to a mount point, with a symbolic... (2 Replies)
Discussion started by: CAGIRL
2 Replies

7. UNIX for Dummies Questions & Answers

Removing a user that doesnt exist from a group

Hi there, normally if I want to remove a user tht I have added to a specific group, i would do the following this is what my group2 looks like # grep group2 /etc/group group2:x:7777:user2,user1,user4 user1 has been defined in a few groups # id -nG user1 group1 group2 group3 So... (3 Replies)
Discussion started by: rethink
3 Replies

8. Shell Programming and Scripting

Remove lines from one file that exist in another file

Hello Everyone, I'm currently have a requirement where I've generated a list of files with specific attributes and I need to know what lines are similar between the two files. For example: -File 1- line1 line2 line3 -File 2- line1 line2 line4 line5 -Desires Output- line1 line2... (5 Replies)
Discussion started by: omnivir
5 Replies

9. Shell Programming and Scripting

File exist for multiple files

Hi, I am unable to achieve the file exist conditions if there are multiple files same similar name for e.g. in a $Direct i am having files like aus.txt aus.txt_pr aus.txt_2012 i need to put a file exist condition like which is not working then echo "File present" but the... (9 Replies)
Discussion started by: rohit_shinez
9 Replies

10. Shell Programming and Scripting

Grep -w ip address from a file isnt working need help

I have a file "file1" that contains several ip address , and the "file2" contains several records , each line in file2 contains somewhere the ip address that i am searching in the file1 I use the unix command grep -w for i in `cat file1` do grep -w "$i" file2 >> file3 done ... (9 Replies)
Discussion started by: knijjar
9 Replies
Bio::UpdateableSeqI(3pm)				User Contributed Perl Documentation				  Bio::UpdateableSeqI(3pm)

NAME
Bio::UpdateableSeqI - Descendant of Bio::SeqI that allows updates SYNOPSIS
See Bio::SeqI for most of the documentation. See the documentation of the methods for further details. DESCRIPTION
Bio::UpdateableSeqI is an interface for Sequence objects which are expected to allow users to perform basic editing functions (update/delete) on their component SeqFeatures. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - David Block Email dblock@gene.pbi.nrc.ca CONTRIBUTORS
Ewan Birney forced me to this... APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ delete_feature Title : delete_feature Usage : my $orphanlist=$self->delete_feature($feature,$transcript,$gene); Function: deletes the specified $feature from the given transcript, if $transcript is sent and exists and $feature is a feature of $transcript, or from $gene if the $feature is a feature of $gene, or from $self if $transcript and $gene are not sent. Keeps track of the features of the $gene object that may be left as orphans and returns them as a listref. Example : I want to delete transcript 'abc' of gene 'def', with three exons, leaving only transcript 'ghi' with two exons. This will leave exons 1 and 3 part of 'ghi', but exon 2 will become an orphan. my $orphanlist=$seq->delete_feature($transcript{'abc'},undef,$gene{'def'}); $orphanlist is a reference to a list containing $exon{'2'}; Returns : a listref of orphaned features after the deletion of $feature (optional) Args : $feature - the feature to be deleted $transcript - the transcript containing the $feature, so that a $feature can be removed from only one transcript when there are multiple transcripts in a gene. $gene - the gene containing the $transcript and/or the $feature perl v5.14.2 2012-03-02 Bio::UpdateableSeqI(3pm)
All times are GMT -4. The time now is 11:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy