LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-20-2006, 10:42 AM   #1
morrolan
Member
 
Registered: Sep 2003
Location: Manchester UK
Distribution: Frustrated Ubuntu 6.10 Edgy User
Posts: 257

Rep: Reputation: 30
Bash: Saving and Variables


Hi guys,

I'm still an amateur when it comes to bash scripting, and I seldom use it.

The trouble I have having is with filenames as variables.

$file contains the name and path of a .jpg to be read.
This is then parsed through exiftags, which extracts the exif data.
Another variable is then given as $file_save, which is the name the parsed data is to be saved as in plain text.

What I want to do, is save the parsed data from the exiftags utility as the filename specified in $file_save, but I can't seem to do it.

I've even tried just saving the contents of $file as the name specified in $file_save, (duplicating it, without using cp etc.)yet I can't even seem to do that.

If someone could please help me with the correct syntax to save the file specified in $file as the filename given in $file_save, It would be much appreciated.

Thanks in advance guys,
 
Old 03-20-2006, 11:03 AM   #2
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
If I understand you correctly, you want to run exiftags on $file and use the output to create $file_save. This can be done with a simple redirect.

As long as $file and $file_save have already been set, you can use something like this (I don't know the syntax of exiftags):

exiftags $file > $file_save
 
  


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
KDE not saving certian environmental variables paranoid times Linux - Software 4 03-03-2006 12:15 AM
bash variables pfaendtner Linux - Newbie 4 11-23-2004 01:00 PM
Saving User-Created Variables feetyouwell Programming 3 02-15-2004 09:56 PM
Variables in bash tcaptain Programming 1 03-03-2003 02:07 PM
Bash variables pk21 Programming 2 01-09-2003 03:31 PM


All times are GMT -5. The time now is 11:15 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration