Been a long time: another broken script
by L_Carver from LinuxQuestions.org on (#5ADZH)
These commands Code:cap=$(exiv2 -g Iptc.Application2.Caption -Pv "$fg")
if [[ -f "$cap" ]]; then
echo -e "$fg \e[1mhas\e[0m a Caption."
clen=${#cap}
echo -e "The caption for $fg is $clen characters long (spaces included)."
echo -e "$fg:\\t$clen" >> captionlengths.txt
fiwork when C&P'd, but not when run as a script (see attached).
(Aside: I'm too much of a cheesehead nowadays to learn printf without having a book like the ABS, sorry about that.)
As usual, please advise corrections (preferably using echo's, .)
Oh and my DM is now Kubuntu 20.04 and change (whatever the latest maint. upgrade is).
Carver
Attached Files


if [[ -f "$cap" ]]; then
echo -e "$fg \e[1mhas\e[0m a Caption."
clen=${#cap}
echo -e "The caption for $fg is $clen characters long (spaces included)."
echo -e "$fg:\\t$clen" >> captionlengths.txt
fiwork when C&P'd, but not when run as a script (see attached).
(Aside: I'm too much of a cheesehead nowadays to learn printf without having a book like the ABS, sorry about that.)
As usual, please advise corrections (preferably using echo's, .)
Oh and my DM is now Kubuntu 20.04 and change (whatever the latest maint. upgrade is).
Carver
Attached Files
![]() | caplength2list.txt (407 Bytes) |