LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-04-2016, 03:47 PM   #1
L_Carver
Member
 
Registered: Sep 2016
Location: Webster MA USA
Posts: 241

Rep: Reputation: Disabled
Another stubborn script.


Almost going to two per day on these.

Error this time is the ubiquitous "File not found."

Here's the code:
Code:
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
 set -xv
while read item
do
 echo "Checking file $item"
  soft=$(exiftool -ALL:Software $item)
  if [ ! -z "$soft" ]; then
	echo "$file0 has a Software \"imprint.\""
	echo "Writing to file."
	echo -e "$file:$soft">> has-software.txt
  fi
done<list.txt
IFS=$SAVEIFS
The script seems simple enough. The list.txt is current (generated by an alias not 60 seconds before I last ran the script), and it has proper Unix line endings. The "set -xv" I added before the last test run, but I saw no code 'quoted' because of the FNF error.

Carver
 
Old 11-04-2016, 04:14 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,607

Rep: Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166
What is the exact error?

Does list.txt exist in the same directory as your script?
 
Old 11-04-2016, 06:01 PM   #3
L_Carver
Member
 
Registered: Sep 2016
Location: Webster MA USA
Posts: 241

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
What is the exact error?
File not found.

Quote:
Originally Posted by michaelk
Does list.txt exist in the same directory as your script?
Yes it does.
 
Old 11-04-2016, 06:35 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,607

Rep: Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166Reputation: 4166
Is the error message something like:
File not found: some_image.jpg

If so the error is generated by exiftool. Is it a path issue to the files in list.txt? Is the loop actually iterating through the list.txt file correctly?
 
Old 11-04-2016, 06:56 PM   #5
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,940

Rep: Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780
what is i list.txt,chances are $item does not contzin a rezl p\th to a file, there may be spaces in the name or it may be empty, check it anc if it doesn't contain a path to file ignore it
 
Old 11-05-2016, 01:07 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,420
Blog Entries: 10

Rep: Reputation: 5237Reputation: 5237Reputation: 5237Reputation: 5237Reputation: 5237Reputation: 5237Reputation: 5237Reputation: 5237Reputation: 5237Reputation: 5237Reputation: 5237
Quote:
Originally Posted by L_Carver View Post
Quote:
Originally Posted by michaelk View Post
What is the exact error?
File not found.
no it isn't.
you're using "set -xv" and the script should spit out a lot more information.
please post the complete output, all of it, including the command you used to start the script.

edit:
"set -xv" should be right under "#!/bin/bash". please change that first.

Last edited by ondoho; 11-05-2016 at 01:08 PM.
 
Old 11-05-2016, 01:19 PM   #7
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,621

Rep: Reputation: 5608Reputation: 5608Reputation: 5608Reputation: 5608Reputation: 5608Reputation: 5608Reputation: 5608Reputation: 5608Reputation: 5608Reputation: 5608Reputation: 5608
http://www.linuxquestions.org/questi...4/#post5611418
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Back with another stubborn BASH script L_Carver Linux - Software 6 11-01-2016 06:28 AM
Stubborn freebsd nc3b *BSD 9 08-22-2006 01:47 PM
Stubborn router Thulemanden Linux - Networking 6 07-29-2006 02:13 PM
stubborn zeroconf BasK Mandriva 14 01-14-2004 04:26 PM
Mozilla being stubborn Dodgy Linux - Software 3 04-27-2003 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration