Adding dates to your photos.

Add date in the photograph with a perl script.

#!/usr/bin/perl

if ($#ARGV < 0 )
{
print \”$#ARGV \\n\”;
print \”Usage $ARGV[0] filename/dir\\n\”;
exit -1;
}

@files = `find \”$ARGV[0]\” -iname \”*jpg\” -print`;

if ($#ARGV > 3 ) { $cmd = 1;}
$count = 1;
foreach $file (@files) {
chomp ($file);

@details = `exif1 \’$file\’`;

$flag = 1;
$flag2 = 0;
$flag_w = 0;
$date = \”\”;
foreach $det (@details) {
@words = split(/–>/, $det);
$_ = $det ;
chomp($words[1]);
if (/Date/ ) {
$date =$words[1] ;
$flag = 0;
}
}

if ($flag) {
@details = `exiftool \’$file\’`;
foreach $det (@details) {
@words = split(/ : /, $det);
$_ = $det ;
chomp($words[1]);
if (/Date\\/Time Original/ ) {
$date =$words[1] ;

}
}
}
system(\”annotate \”$date\” \”$file\” \”$file\”\”);

$count ++;
}

Stop long commands wrapping around and over-writing itself in the Bash shell

Stop long commands wrapping around and over-writing itself in the Bash shell

shopt -s checkwinsize

add the command either in /etc/profile or ~/.bash_profile so that this is available to your shell.

* View this command to comment, vote or add to favourites * View all commands by settermjd

commandlinefu.com

by David Winterbottom (codeinthehole.com)

URL: http://feedproxy.google.com/~r/Command-line-fu/~3/_0MaJbX9Jvo/stop-long-commands-wrapping-around-and-over-writing-itself-in-the-bash-shell

\"Reblog