continue example


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting continue example
# 8  
Old 07-03-2007
Quote:
Originally Posted by Shell_Life
Xramm,
According to what you said, you are looking for:
1) Search for a pattern into a file name.
2) At the end, display the total size of all files with pattern in their name.
Based on your specification, here is one solution not having to read the
entire file to find how many characters it has -- very useful for large files.
Code:
typeset -i mSize
typeset -i mTotal=0
mPattern='core'
for mFile in `find . -type f -name "*${mPattern}*"`
do
  mSize=`ls -l $mFile | tr -s ' ' | cut -d' ' -f5`
  mTotal=${mTotal}+${mSize}
done
echo 'Total size of '$pattern' is '${mTotal}

Yes . it is what I am looking for, great Smilie
thx shell_life
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Case statement - continue

I have a case statement. IS "continue" working in case? for file in ls dir/* case $file in a) do something continue ;; b) do something continue ;; esac It is a Bourne shell (13 Replies)
Discussion started by: digioleg54
13 Replies

2. Shell Programming and Scripting

Continue the loop if the value is not found

Dear Help, Is it possible to continue the loop by going to the next available value, if the 'expected value' is not found. I have a list of values which might not get incremented by fixed value and hence the loop could break and the script could terminate. Any suggestion is appreciated. ... (1 Reply)
Discussion started by: Indra2011
1 Replies

3. Shell Programming and Scripting

If else continue to check value until it it is right

i have script which get Input via READ value and compare it from file. when found do some stuff...if not found again ask for Input until you dont enter Right value. #!/bin/ksh echo "SID must be in oratab file" echo "Enter ORACLE_SID of Database:\c " read ORACLE_SID x=`cat /etc/oratab|... (3 Replies)
Discussion started by: tapia
3 Replies

4. Shell Programming and Scripting

Continue problem

Hey all. First-time poster, long-time reader I'm on Mac, and I've written a long script to open up a maximum of 20 Terminal windows and run a subscript with a different input in each of them. When each of these sub-scripts finishes, it changes the value of a variable ("$windows") by -1, which... (4 Replies)
Discussion started by: Diabadass
4 Replies

5. Shell Programming and Scripting

Break vs Continue

Okay so I am having trouble understand what the computer will do with a code like this if ; then echo echo "Found the file" blah blah blah for i in `blah blah blah` ; do ... (2 Replies)
Discussion started by: shade917
2 Replies

6. Shell Programming and Scripting

Restart and then continue script

How can I get a script to complete a update, varifiy completion, resboot, and continue with script? Is it possbile to get script to add itself to the "startup application" list #!/bin/bash clear sudo apt-get update #Verify/test the update completed #Reboot #Start/comtinue... (9 Replies)
Discussion started by: wolfgangcs
9 Replies

7. Shell Programming and Scripting

Are you sure you want to continue connecting (yes/no) need a way to pass in the value yes without

Are you sure you want to continue connecting (yes/no) need a way to pass in the value yes without use the except command. I am creating a script to send down files to an application servers every time it reboots as it picks up the newest image. I do not want to manual connect to each server... (1 Reply)
Discussion started by: 3junior
1 Replies

8. Shell Programming and Scripting

awk continue

I want to print entire row of file awk '{print $0}' inputfile but sometime before every row have space characters. Example: " HVLR is not in service on AP 54" How can i print entire row without space characters ? thanks (3 Replies)
Discussion started by: anhtt
3 Replies

9. UNIX for Advanced & Expert Users

Continue an 'scp' tranfser?

I was in the middle of transferring a file over a slow link (768k) using 'scp'. The system on this end got rebooted by an overzealous co-worker... I've got 500+ megs of the file here and 725 megs to go. I'd really hate to start over. I fear that the answer to my question is that I will have to... (3 Replies)
Discussion started by: deckard
3 Replies

10. UNIX for Advanced & Expert Users

continue the suspended jobs

Guys, Any idea how to continue suspended job in background ? ihave tried to use the bg% command <root> but it doesnt work. unix> jobs +suspended du > usage -suspended (sleep 60; date) unix> bg %2 (sleep 60; date) But my suspended work doesnt seems to continue run in background.. Any... (6 Replies)
Discussion started by: killerserv
6 Replies
Login or Register to Ask a Question
EBOOK-META(1)							      calibre							     EBOOK-META(1)

NAME
ebook-meta - part of calibre SYNOPSIS
ebook-meta ebook_file [options] DESCRIPTION
Read/Write metadata from/to ebook files. Supported formats for reading metadata: azw, azw1, cbr, cbz, chm, epub, fb2, html, imp, lit, lrf, lrx, mobi, odt, oebzip, opf, pdb, pdf, pml, pmlz, prc, rar, rb, rtf, tpz, txt, zip Supported formats for writing metadata: azw, azw1, epub, lrf, mobi, pdb, pdf, prc, rtf, tpz Different file types support different kinds of metadata. If you try to set some metadata on a file type that does not support it, the metadata will be silently ignored. Whenever you pass arguments to ebook-meta that have spaces in them, enclose the arguments in quotation marks. OPTIONS
--version show program's version number and exit -h, --help show this help message and exit -t, --title Set the title. -a, --authors Set the authors. Multiple authors should be separated by the & character. Author names should be in the order Firstname Lastname. --title-sort The version of the title to be used for sorting. If unspecified, and the title is specified, it will be auto-generated from the title. --author-sort String to be used when sorting by author. If unspecified, and the author(s) are specified, it will be auto-generated from the author(s). --cover Set the cover to the specified file. -c, --comments Set the ebook description. -p, --publisher Set the ebook publisher. --category Set the book category. -s, --series Set the series this ebook belongs to. -i, --index Set the index of the book in this series. -r, --rating Set the rating. Should be a number between 1 and 5. --isbn Set the ISBN of the book. --tags Set the tags for the book. Should be a comma separated list. -k, --book-producer Set the book producer. -l, --language Set the language. -d, --date Set the published date. --get-cover Get the cover from the ebook and save it at as the specified file. --to-opf Specify the name of an OPF file. The metadata will be written to the OPF file. --from-opf Read metadata from the specified OPF file and use it to set metadata in the ebook. Metadata specified on the command line will over- ride metadata read from the OPF file --lrf-bookid Set the BookID in LRF files SEE ALSO
The User Manual is available at http://calibre-ebook.com/user_manual Created by Kovid Goyal <kovid@kovidgoyal.net> ebook-meta (calibre 0.6.53) July 2010 EBOOK-META(1)