Sponsored Content
Top Forums Shell Programming and Scripting Code to remove files when corresponding file doesnt exist isnt working. Post 302590315 by Chubler_XL on Sunday 15th of January 2012 05:30:14 PM
Old 01-15-2012
You Don't want backquotes in the for command line. Try something like this:

Code:
for transcriptfile in *.transcript
do
   wavfile=${transcriptfile%.*}.wav
   [ -f "$transcriptfile" -a ! -f "$wavfile" ] && rm -f "$transcriptfile"
done

 

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
TONEDEBUG(1)						    Voicetronix Telephony Tools 					      TONEDEBUG(1)

NAME
tonedebug - Test parameters for the libvpb programmable tone detector SYNOPSIS
tonedebug [options] DESCRIPTION
The tonedebug utility assists with quickly testing tone detector parameters against the signals they are intended to detect. It has three main modes of operation for testing single continuous or pulsed tones, or for testing a set of tones specified in the environment. OPTIONS
The following common options apply for all modes: --card number Explicitly select the card to test. Default is card 0. --port number Explicitly select the port to test. Default is port 0 of the card being tested. -w wavfile Specify a wav file to play the tones from. For OpenLine and OpenSwitch cards it should be played to an FXO port with no phone line connected, and the tone detector will process the reflected signal from the hybrid circuit. The OpenPCI cards have almost no echo from this circuit, but an on hook phone connected to an FXS port should produce a detectable echo signal. -s filename.c Writes out a C function that can be included in your own code to configure the tone generator with the settings being tested. Environment options To run tonedebug using the settings specified with the VPB_TONE environment variables, call it with the -e option. For example: $ tonedebug -e --port 4 -w my.wav Will use the enviroment settings to try and detect tones from my.wav played into port 4 of card 0. There are no other options specific to this mode. Continuous tone options If passed the -c option, then the tonedebug utility will test parameters suitable for a continuous tone. For example: $ tonedebug -c 425 100 2000 -w dialtone.wav -t dial Will try to detect 2 seconds of 425Hz tone from dialtone.wav, played into port 0 of card 0. If it succeeds it will report a dial event. The following additional options may be used in this mode: -c center-freq bandwidth duration Specifies the primary tone characteristics, its frequency and bandwidth in Hz. and its minimum duration in milliseconds. -d center-freq2 bandwidth2 Specifies the second tone of a multi-frequency tone. -q twist Specifies the twist of a multi-frequency tone. -n snr Specifies the acceptable signal to noise ratio, in dB. -t dial | busy | ringback Specifies the name of a predefined tone to replace with the given settings. Pulsed tone options The -p options will enable testing for pulsed tones. In addition to the common options and the options for continuous tones, the following options are supported in this mode: -p center-freq bandwidth on-time Specifies the primary tone characteristics, its frequency and bandwidth in Hz. and its 'on' time in milliseconds. -off off-time The 'off' time of the pulse in milliseconds. SEE ALSO
tonetrain(1) BUGS
We rely on an echo from the hardware to feed the signal into the tone detector. This should be fixed to feed it in directly at some stage in the future. AUTHOR
Ron Lee, David Rowe, Voicetronix <support@voicetronix.com.au> This manual page was written by Ron <ron@debian.org>, for the Debian project (but may be used by others). VPB driver package Feb 2, 2007 TONEDEBUG(1)
All times are GMT -4. The time now is 11:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy