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
mapivi
MAPIVI(1) User Contributed Perl Documentation MAPIVI(1)NAME
MaPiVi - Picture Viewer and Organizer
MaPiVi means Martin's Picture Viewer
DESCRIPTION
JPEG picture viewer / image management system with meta info support written in Perl/Tk for UNIX, Mac OS X and Windows.
I wrote mapivi just for me, because I needed a image viewer which is also able to display and edit meta infos of JPEG pictures, like EXIF,
JPEG comments and IPTC/IIM infos. As hobby photographer I am mostly interested in the EXIF infos (like timestamp, camera model, focal
length, exposure time, aperture, etc.) and the possibility to add and edit IPTC infos and JPEG comments. But I also want to rename
pictures according to their internal date/time and to do lossless rotation, lossless cropping and other stuff.
mapivi can be found here: http://mapivi.de.vu (link to the mapivi site) or if this won't work: http://herrmanns-stern.de (real site)
http://sourceforge.net/projects/mapivi (download)
I would be happy to receive some feedback (e.g. on which os mapivi works), bugfixes, patches or suggestions about mapivi.
Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Martin Herrmann All rights reserved.
Feel free to redistribute. Enjoy!
USAGE
mapivi [-i ] [file|folder]
to display a certain picture use:
mapivi picture.jpg
mapivi will generate and display all pictures in the folder as thumbnails. The given picture will be displayed in original size or zoomed
to fit the window (picture frame).
to view a folder containing pictures use:
mapivi ~/pics/
mapivi will generate and display all pictures in the given folder as thumbnails.
to start mapivi with the import wizard
mapivi -i
KEYS
mapivi is controlled by the following keys: see also menu Help->Keys (the list is generated from the source code and is always actual.)
Space, Page-Down
Show the next picture in folder
BackSpace, Page-Up
Show the previous picture in folder
Escape
Iconify MaPiVi (Boss-Key :)
Cursor-up, -down, -left, -right
Scroll the picture, if it's bigger than the Canvas
Shift-Cursor-up, -down, -left, -right
Move to the border of the picture, if it's bigger than the Canvas
q Quit MaPiVi
For all other key bindings, see the menu Help->Keys
MOUSE
Try the right mouse button in the thumbnail picture list for a popup menu to copy, move, rename, rotate or delete pictures, to open a new
folder, to add or remove comments or to exit MaPiVi.
Use the buttons to add, edit or remove JPG comments, or to display all EXIF infos.
If you hold the mouse over the buttons or labels a help message will pop up (or at least at most of them :).
perl v5.10.0 2009-04-03 MAPIVI(1)