Sponsored Content
Top Forums Shell Programming and Scripting how to format a list of files from ls? Post 302363648 by cfajohnson on Wednesday 21st of October 2009 01:04:22 AM
Old 10-21-2009
Quote:
Originally Posted by vidyadhar85
you can do that with a simple command..
Code:
for dir_name in `ls *.SpeechVoice` ; do


Not only is ls unnecessary, but it will break the script if any filenames contain spaces. Use wildcard expansion directly.
Quote:
Code:
basename  $dir_name .SpeechVoice
done


And there's no need for the external command, basename.

Code:
for dir_name in *.SpeechVoice
do
  printf "%s\n" "${dir_name%.SpeechVoice}"
done

In bash or ksh93, it can be done much faster using an array:

Code:
x=( *.SpeechVoice )
printf "%s\n"  "${x[@]%.*}"


Last edited by cfajohnson; 10-23-2009 at 12:50 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with find command and list in a long format each found file

The purpose of those comands are to find the newest file in a directory acvrdind to system date, and it has to be recursively found in each directory. The problem is that i want to list in a long format every found file, but the commands i use produce unexpected results ,so the output lists in a... (5 Replies)
Discussion started by: alexcol
5 Replies

2. Shell Programming and Scripting

List files and display last modify time in a particular format

hi everyone, can someone suggest how i can list the contents of a directory and display their corresponding last modify time in the format yyyymmddhhmm? thanks in advance! (16 Replies)
Discussion started by: Deanne
16 Replies

3. Shell Programming and Scripting

changing the format of the list

I have a file such that List : a, b, c, d I want to list this as List a b c d however the trick is the number of arguments in the list is varies. There might be 0-7 variables . Can you help me? Please use code tags when posting data and code samples! (5 Replies)
Discussion started by: ozum
5 Replies

4. Shell Programming and Scripting

Need your help to get the output of the list in desired format

Hello Guys, I am working on a script and using the below code to fetch the list of all repositories CHDIR='/mnt/scm/subversion/' repolist() { cd ${CHDIR} Repo=`ls|cut -d " " -f1` echo $Repo } Output of the above code is BSB CIB COB DCI DIB DSB ESB-P ESB-TOOLS FareVerify GCACHE GWY... (15 Replies)
Discussion started by: rohit22hamirpur
15 Replies

5. Shell Programming and Scripting

search for content in files. Name of files is in another file. Format as report.

Hi I have multiple files in a folder and one file which contains a list of files (one on each line). I was to search for a string only within these files and not the whole folder. I need the output to be in the form File1<tab>string instance 2<tab> string instance 2<tab>string instance 3... (6 Replies)
Discussion started by: pkabali
6 Replies

6. Shell Programming and Scripting

Need script for transferring bulk files from one format to text format

"Help Me" Need script for transferring bulk files from one format to text format in a unix server. Please suggest (2 Replies)
Discussion started by: Kranthi Kumar
2 Replies

7. UNIX for Dummies Questions & Answers

Rename all Files in a UNIX Directory from one date format to another date format

Hi Unix Gurus, I would like to rename several files in a Unix Directory . The filenames can have more than 1 underscore ( _ ) and the last underscore is always followed by a date in the format mmddyyyy. The Extension of the files can be .txt or .pdf or .xls etc and is case insensitive ie... (1 Reply)
Discussion started by: pchegoor
1 Replies

8. Shell Programming and Scripting

Long list file display different time format.

Hi Gurus, I have some weird issue. when using ls -l the result shows different time format: -rw-r--r-- 1 abc gourp1 3032605576 Jun 14 2013 abc -rw-rw-r-- 1 abc gourp1 1689948832 Aug 10 06:22 abc one display 2013 which is year; another one displays 06:22 which is time. ... (4 Replies)
Discussion started by: ken6503
4 Replies

9. Shell Programming and Scripting

How to find list of missing files based on the file format?

Hi All, In the file names we have dates. Based on the file format given by the user, if any file is not existed for a particular date with in a given interval we should consider that file is missing. I have the below files in the directory /bin/daily/voda_files. ... (9 Replies)
Discussion started by: nalu
9 Replies

10. UNIX for Beginners Questions & Answers

Not sure how to describe it but how to format this list so that it print the 1st field once only

Hi, Not sure how to describe the problem. But basically, I have this file listing here app01_app.test.com.ph|PROGRAM=SQL Developer|HOST=AKL0TS100|USER=Admtest01|HOST=10.111.12.23| app02_app.test.com.ph|PROGRAM=D:\interface\apps\bin32\batch.exe|HOST=AKL0TS100|USER=Admtest09|HOST=10.111.12.35|... (3 Replies)
Discussion started by: newbie_01
3 Replies
espeak(1)							   User Commands							 espeak(1)

NAME
espeak - a compact open source software speech synthesizer SYNOPSIS
espeak [option...] [words] DESCRIPTION
espeak is a compact open source software speech synthesizer. It can run as a command line program to speak text from a file or from stdin. Main features of espeak: * Includes different voices, whose characteristics can be altered. * Can produce speech output as a WAV file. * Supports SSML (Speech Synthesis Markup Language - not complete) * Supports HTML. * Is compact in size. * Can translate text to phoneme codes, so it could be adapted as a front end for another speech synthesis engine. * Is written in C++. OPTIONS
The following options are supported: -a integer Amplitude as an integer in the range from 0 to 200, default is 100. -b Input text is 8-bit encoded. -f text_file Speak text from text_file. -g integer Specify the word gap, or the pause between words, as an integer. Units of 10mS at the default speed. -k integer Indicate how to speak capital letters as an integer. The argument can have the following values: 1=sound, 2=the word "capitals", higher values=a pitch increase (try -k 20). -l integer Line length as an integer. If not zero (which is the default), consider lines less than this length as end-of- clause. -m Interpret SSML markup, and ignore other < > tags. -p integer Pitch adjustment as an integer in the range from 0 to 99, default is 50. -q Quiet, do not produce any speech (may be useful with -x). -s integer Speed as an integer meaning words per minute. Values can be from 80 to 370, default is 170. -v voice_file Use specified voice_file. -w filename Write output to the specified filename, in WAV format, rather than speaking it directly. -x Write phoneme mnemonics to stdout. -X Write phonemes mnemonics and translation trace to stdout. -z No final sentence pause at the end of the text. --compile=voice_name Compile the pronunciation rules and dictionary in the current directory. The voice_name value is optional and spec- ifies which language to use. --punct="characters" Speak the names of punctuation characters while speaking. If the characters value is omitted, all punctuation is spoken. --split=minutes Starts a new WAV file every minutes. Used with -w. --stdin Read text input from stdin instead of a file. --stdout Write speech output to stdout. --voices=language List the available voices for the specified language. If language is omitted, then list all voices. FILES
The following files are used by espeak: /usr/lib/libespeak.so Library for espeak speech synthesis /usr/share/espeak-data Directory of voice language and data files ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWespeak | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ NOTES
espeak was written by Jonathan Duddington. SEE ALSO
orca(1), libespeak(3), libgnomespeech(3), attributes(5) Additional information is available from the following site: http://espeak.sourceforge.net/ SunOS 5.11 20 Aug 2008 espeak(1)
All times are GMT -4. The time now is 05:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy