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, |
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 |
All times are GMT -5. The time now is 10:13 AM. |