Sponsored Content
Top Forums Shell Programming and Scripting script to disc-at-once extract audio books with cdparanoia Post 302560072 by agama on Wednesday 28th of September 2011 07:44:08 PM
Old 09-28-2011
For some odd reason, cdparanoia seems to write to stderr and not stdout and that is why the list didn't go to grep. A simple redirect and pipe to awk and you'll have your answer without having to do any counting, and without depending on the it always writing the same number of header/trailer lines.

Code:
#!/usr/bin/env ksh
cdparanoia -Q 2>&1| awk ' $1+0 > 0 { n=$1+0; next; } END { print n}' |read END

and if you must use bash
Code:
#!/usr/bin/env bash
END=$(cdparanoia -Q 2>&1| awk ' $1+0 > 0 { n=$1+0; next; } END { print n}' )

 

9 More Discussions You Might Find Interesting

1. Solaris

Ultra 10 - Copying Files From Disc After Booting Up With Recovery Disc?

Hello, I'm still learning unix and I have what is probably a simple question but I can't seem to find the question to. I have an Ultra 10 Sparc Server running solaris 8 and the drive may have crashed (I hope not). Currently, it appears some files in the /etc folder are missing. I have a backup... (1 Reply)
Discussion started by: ideffects
1 Replies

2. Shell Programming and Scripting

Books for Shell Script and UNIX

Hi i am new to UNIX completely. i dont know any thing about UNIX. can some one please help me with some books on the unix archetecture and all the internal working of UNIX OS (i want to know every thing about unix from basics) and shell programming. can any one please if available provide... (1 Reply)
Discussion started by: amiman
1 Replies

3. Shell Programming and Scripting

Script to list files not present in audio.txt file

I am having following folder structure. /root/audios/pop /root/audios/jazz /root/audios/rock Inside those pop, jazz, rock folders there are following files, p1.ul, p2.ul, p3.ul, j1.ul, j2.ul, j3.ul, r1.ul, r2.ul, r3.ul And I have a file named as "audio.txt" in the path /root/audios,... (11 Replies)
Discussion started by: gopikrish81
11 Replies

4. Shell Programming and Scripting

Error with Audio Conversion Bash Script

Good evening, I'm currently working on a BASH script to convert audio between file formats and I've come across a snag. At the beginning of the script, I'm having the system check to see if any files with the .m4a extension exist in the directory, and if so, it runs the script. If there are no... (1 Reply)
Discussion started by: KBurkholder
1 Replies

5. Slackware

Problems with audio recording in Audacity 2.0.5. Slackware64 14.1; Intel HD Audio.

I'm trying to record audio using Audacity 2.0.5 installed from SlackBuilds. My system is 64-bit Slackware 14.1 and a sound card is Intel HD Audio. I didn't change my sound system to OSS. (Default sound system in Slackware 14.1 is ALSA, isn't it?) First, I set Internal Microphone slider in KMix... (2 Replies)
Discussion started by: qzxcvbnm
2 Replies

6. OS X (Apple)

Python script to do simple audio capture...

This site is the first to get this snippet. It will capture an audio recording of any time length within the limits of OSX's QuickTime Player's capablility... A shell script derivative of this will be used as a further capture for CygWin's AudioScope.sh. Thoroughly read ALL the comments in... (0 Replies)
Discussion started by: wisecracker
0 Replies

7. Shell Programming and Scripting

Need a script for automation the convert a lot number audio files to another format

I have a lot number audio files in the MP3 proprietary format, I want to convert them to 'opus' the free and higher quality format, with keep metadata also. My selection command-line programs are SoX (Sound eXchange) for convert MP3 files to 'AIFF' format in order to keep quality and metadata*... (1 Reply)
Discussion started by: temp-usr
1 Replies

8. Shell Programming and Scripting

The Start Of A Simple Audio Scope Shell Script...

This is a DEMO shell script to generate a simple graticule and plot inside it... Apologies for any typos... it is another building block along with my other two shell uploads recently to start a semi_serious project of an Terminal_AudioScope... The fist upload I posted recently was to show... (83 Replies)
Discussion started by: wisecracker
83 Replies

9. What is on Your Mind?

Neo's Recommended Audio Books

Just finished this Audible audio book. It's simply great. Highly recommended: This book was so well done that I did not want to miss a single word; so ended up listening to half of the book twice when I got distracted. This is a great audio book. ... (0 Replies)
Discussion started by: Neo
0 Replies
CDTOOL(1)							   User Commands							 CDTOOL(1)

NAME
cdtool - play and catalog audio CDROMs on CDROM drive(s) SYNOPSIS
cdeject [-[0..9]|-d device] [-V|-?|-h] cdclose [-[0..9]|-d device] [-V|-?|-h] cdir -n [-[0..9]|-d device] [-r|-s|-t|-V|-?|-h] cdinfo [-[0..9]|-d device] [-a|-r|-s|-t|-v|-V|-?|-h] cdpause [-[0..9]|-d device] [-V|-?|-h] cdplay [-[0..9]|-d device] [start [stop] cdplay [-[0..9]|-d device] [+|- number] cdplay [-[0..9]|-d device] [start|stop|resume|eject|close|info|dir] cdplay [-[0..9]|-d device] [-V|-?|-h] cdstop [-[0..9]|-d device] [-V|-?|-h] cdvolume [-[0..9]|-d device] [-V|-?|-h|level] cdshuffle [-[0..9]|-d device] [-V|-?|-h] DESCRIPTION
The cdeject command ejects the current compact disc. The cdclose command closes the CDROM tray. The cdir command lists information about the currently loaded audio compact disc. In particular, it lists the lengths of all tracks. It also references the database files specified in the CDTOOLPATHDB environment variable and the ~/.cdtooldb file, which use a simplified ver- sion of the format used by workman(1). If one of these files contains an entry for the current compact disc, cdir will print title, artist, and track name information. -n Do not lookup any information in the database files. -s Print information in a short format: only author, title, and current track, all on one line. -t Print a template for the current cd, including title, artist, and track name information if available. If blank lines are filled in, this can be appended to the ~/.cdtooldb file. The cdinfo command, with no option used, will print out the audiostatus (playing, etc.). -a Print out the absolute disc time. -r Print out the relative track time. -s Print out the audiostatus. -t Print out the current track. -v All info: status track absolute relative. The cdpause command pauses the currently playing compact disc. Resume by using cdplay with no arguments. The cdplay command plays the compact disc. If called with one argument, this is the starting track number. If called with two arguments, these are the starting and stopping track numbers. If the first argument is a + or - then skip the number of tracks given by the second argument forward or backward. If no second argument is give, skip one. A 0 as first argument or no argument replays current track. The cdstop command stops the compact disc, if it is playing. The cdvolume command sets the output volume level of the CD player. The level is an integer from 0 to 255. The cdshuffle command plays the audio tracks on the disc in random order. The default device opened is /dev/cdrom. This default and others may be changed in config.h. Options supported by all programs are: -[0..7] Multiple cdrom support to open /dev/scd0../dev/scd7 [by default]. -d device Multiple cdrom support to open device by name. [-h|-?] Print out help for the command. -V Print out version information and build information. -D Enable runtime debugging. FILES
~/.cdtooldb - default database file. ENVIRONMENT
CDTOOLDBPATH - colon delimited path of database files to search. It is not necessary to specify ~/.cdtooldb, as this is automatically added to the end of the search path. CDTOOLDEV - device file for cd-rom, overrides compile-time defaults. SEE ALSO
cdctrl(1), cdadd(1), cdown(1) AUTHORS
Main code: Thomas Insel <tinsel@tinsel.org> Enhancements: Byron Ellacott <rodent@homer.humbug.org.au> Wade Hampton <whampton@staffnet.com> Lin Zhe Min <ljm@ljm.wownet.net> Sven Oliver Moll <smol0075@rz.uni-hildesheim.de> Daniel R. Risacher <risacher@worldnet.att.net> Max Vozeler <max@hinterhof.net> CDTOOL
29-July-2004 CDTOOL(1)
All times are GMT -4. The time now is 11:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy