Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-20-2006, 11:42 AM   #1
Registered: Sep 2003
Location: Manchester UK
Posts: 264

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, 12:03 PM   #2
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


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 01:15 AM
bash variables pfaendtner Linux - Newbie 4 11-23-2004 02:00 PM
Saving User-Created Variables feetyouwell Programming 3 02-15-2004 10:56 PM
Variables in bash tcaptain Programming 1 03-03-2003 03:07 PM
Bash variables pk21 Programming 2 01-09-2003 04:31 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:06 PM.

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