I couldn't tell from your code whether the filenames had the suffix tacked onto the end (picture.jpgxxxx) or picture.xxxx.jpg. The ls command implies the latter, but you seem to be stripping off xxxx as the trailing 4 characters. You might be getting tripped up with this too. If you post a sample of filenames and a sample of your text file, it'd make giving suggestions a bit easier.
They were more like this (a current example right from the "victim" directory):
My rename script, which I run once these have been annotated according to the four letters preceding the ".", chops off that four-letter substring with what you saw in my script in this thread as the 'puregrain' variable (in the other script, it's an m.)
Quote:
Nitpicking now.... the statement
can be written more simply:
This is easier to read, and depending on the shell it more efficient. There might also be ways to make sussing the field data from the text file more efficient; using external processes like 'cut' introduce overhead that can eat your lunch as far as performance is concerned.
I asked about performance and efficiency in simplification on one thread I started over on the LQ forum. The person there who was giving me advice (and has done so, before and since) was rather vague about it. If it's a shell-by-shell or build/version-by-build/version thing, I understand why now. Trial and error -- don't mind it so long as my bash will still fork commands in the morning
I have a file that lists data about a system. It has a part that can look like:
the errors I'm looking for with other errors:
Alerts
Password Incorrect
Login Error
Another Error
Another Error 2
Other Info
or, just the errors I need to parse for:
Alerts
Password Incorrect
... (9 Replies)
For a field format such as AAL1001_MD82, how do I select(and use in if statement) only the last four elements( in this case MD82) or the first three elements (in this case AAL)?
For instance, how do I do the following - if first three elements of $x == yyy, then ... (5 Replies)
i have a variable MYHOST that has my host name.depending on the host i have an array like A_<hostname>.Everytime i need to append the hostname to A_ to get the array.but in the shell script i am nt able to access the members of that array.
code of what i hav done:
export temp=A_$MYHOST
for... (15 Replies)
Hi there,
I have included an external properties file into my BASH script via the 'source' command.
I am attempting to dynamically assign a variable in the BASH script, that references the variable name within the external properties file i.e.
#!/bin/bash
pth=${0%/*}
source... (3 Replies)
Hello All,
I am having this issue...where I am actually having hard time understanding the problem:
The code is as follows:
#include<iostream.h>
void fxn(char*** var)
{
int i =4;
*var = (char**)malloc(i*sizeof(char*));
for(int j =0; j<4; j++)
{
*var = "name";
cout<<*var;... (6 Replies)
Here is the question...
Create a new script, sub2, taking three parameters...
1.) the string to be replaced
2.) the string with which to replace it
3.) the name of the file in which to make the substitution
...that treats the string to be replaced as plain text instead of as a regular... (1 Reply)
Dear all,
I believe this is a Bash basic question... I am bit ashamed for asking actually...
I want to create a Bash script that compares 2 different folders:
1) work_folder
and
2) work_folder.git
#!/bin/bash
FOLDER_NAME=`pwd | awk -F/ '{ print $NF }' | awk -F. '{ print $1 }'`
... (6 Replies)
Discussion started by: freddie50
6 Replies
LEARN ABOUT DEBIAN
bins_edit
BINS(1) General Commands Manual BINS(1)NAME
bins_edit -- Set fields in XML picture description files for BINS
SYNOPSIS
bins_edit [-a | --album ] [-m | --html ] [-t title | --title title ] [-e event | --event event ] [-l location | --location loca-
tion ] [-p people | --people people ] [-y date | --date date ] [-d description | --description description ] [--longdesc longDe-
scription] [--shortdesc shortDescription] [--sample pictureFileName] [-g tag=value | --generic tag=value ] [-h | --help ] [-v |
--verbose ] [-q | --quiet ] [file] [files ...]
DESCRIPTION
This manual page documents briefly the bins_edit command.
This manual page was written for the Debian distribution because the original program does not have a manual page. Instead, it has docu-
mentation in HTML in /usr/share/doc/bins/index.html as well as a --help option.
bins_edit sets values in the XML picture description files that bins(1) uses to generate galleries.
OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included
below.
file By default, file is the filename of the XML file with the image properties. If the argument has no .xml suffix, it is added, so
you can directly give picture names on the command line. Spaces and other special characters (even newlines) can be used in val-
ues given as parameters as long as they are enclosed between quotes.
If the --album option is given, the filename refers to the directory of images, and the album.xml in that directory will be modi-
fied instead.
-a
--album edit album description (instead of the default of editing the image description.) In this case, the file parameter must be the
source directory of the album. Only the --title, --longdesc, --shortdesc and --sample switches make sense
with this option.
-m
--html input value will be interpreted as HTML code, thus, no HTML encoding or quoting will be done.
-t title
--title title
Set the title (of an image.)
-e event
--event event
Set the event name (of an album or image.)
-l location
--location location
Set the location (of an image.)
-p people
--people people
Set the list of people (of an image.)
-y date
--date date
Set the date (of an image.)
-d description
--description description
Set the description (of an image.)
--longdesc longDescription
Set the long description (of an album.)
--shortdesc shortDescription
Set the short description (of an album.)
--sample pictureFileName
Select the sample picture, within this album, to be used on the album list (template subalbum.html.) Note that the filename is
relative to the album directory, and thus doesn't have a directory component.
-g tag=value
--generic tag=value
This lets you set arbitrary fields in the relevant XML file (of the image or the album.) Generic tags appear inside description
which appears inside image; the tag appears as the name attribute of a field element, and the value appears as the content
of the element.
-h
--help Gives quick help (which this man page is based on.)
-v
--verbose This switch can appear several times to increase verbosity level.
-q
--quiet Suppress output.
EXAMPLES
Set the title of the Image.jpg file to "My picture":
bins_edit -t "My picture" Image.jpg
Set the title and location of all JPEG pictures in the directory:
bins_edit --title Holiday --location Paris *.jpg
Use of HTML values:
bins_edit --html --description '<b>BINS</b> is cool' file.jpg
Set the title short description and sample image of the album in the current directory (note the dot as final parameter):
bins_edit -a -t "My Album" --sample image.jpg --shortdesc "This is my album" .
SEE ALSO
bins (1).
AUTHOR
This manual page was written by Mark W. Eichin eichin@thok.org for the Debian system (but may be used by others). As it is mostly derived
from the bins_edit program itself, it is covered by the GNU General Public License.
BINS(1)