04-28-2010
Hi.
The brackets (braces) are backslashed to give them special meaning (they would otherwise be literal braces).
^ matches something at the beginning of the line (an empty string because it doesn't remove anything from the pattern space), but has special meaning if it's the first character after a square braclet [ (in which case it negates the match (i.e. ^[0-9] means match a number at the start of a line, whereas ^[^0-9] means don't match a number at the start of a line, and [^0-9] means don't match a number, wherever [^0-9] appears in your expression).
In your expression ^.\{42\} means match 42 of any character starting at the beginning of the line, as DrSammy described.
Last edited by Scott; 04-28-2010 at 07:50 PM..
Reason: typo
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
There are files on a remote server with the file name ending in "mm-dd-yy.txt". The script I am running is:
mls "Daily_Service_Text_File_*" /my/local/dir/Filelisting.txt
nawk -F_ -f file.awk /my/local/dir/Filelisting.txt | sort -k1n | cut -f2- | tail -1
It worked up too "12-31-07.txt" but... (3 Replies)
Discussion started by: bbbngowc
3 Replies
2. Shell Programming and Scripting
I found this very useful perl script that will check a remote ftp server, search for files of a specific time and get them. When I run the script it works, but it gave me the following error:
Couldn't get filename_12-13-07.txt Bad file number
What in this script would cause this? I know... (2 Replies)
Discussion started by: bbbngowc
2 Replies
3. UNIX for Dummies Questions & Answers
Hi people I am trying to learn this code and see how it relates to the old DOS days. I have a line of code that I am not sure what the first part does. Any help will be greatly appreciated.
It is from a Save command that is used to backup files to a directory.
It goes like this
if ;then... (10 Replies)
Discussion started by: coyote1967
10 Replies
4. Shell Programming and Scripting
Hi,
I have a script at the moment of which reads in simply what the latest version is within a folder i.e. v001, v002, v003 etc and then stores this latest version in a variable i.e. $LATEST would echo v003. I have then cut this string so that I only consider the 003 part. I would then like to... (3 Replies)
Discussion started by: cyberfrog
3 Replies
5. Programming
I am trying to simplify the coding in a script I was given, but it was written 7-10 years ago and is pretty complicated. below is a tidbit, if someone can break it down for me I would appreciate it.
sub ParseText
{
my ($line, $key, $value, $sub, $script);
foreach $line (@_)... (0 Replies)
Discussion started by: callyvan
0 Replies
6. Shell Programming and Scripting
I'm going through my bash book and came across this if statment.
if *$)" ]; then
the book says that the grep expression means "an initial dash followed by a digit" (which I understand) "optionally followed by one or more digits" That's the part I can't figure out -- I know the * is a... (8 Replies)
Discussion started by: Straitsfan
8 Replies
7. Programming
I have a string, eg 7f30.3 and I want to store things in the following way
npos = 7
decform = true
width = 30
ndp = 3
I need to read each character one by one. I am coding in fortran but I can try to code it should answer be given in C in the above way. (2 Replies)
Discussion started by: kristinu
2 Replies
8. UNIX for Beginners Questions & Answers
Dear experts,
I am a relative novice in the Unix and came across a very useful code that I regularly use for my research blindly. I am wondering if any of the professional members could kindly briefly explain to me what the code actually does?
Many thanks in advance
The script is
awk... (4 Replies)
Discussion started by: arsalane
4 Replies
LEARN ABOUT SUSE
ebook-meta
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)