Simplifying a script
I have a script using Exiftool to remove the software tag, comment header line and date data (in both EXIF and IPTC) from files saved with Gimp 2.8 or 2.9. I want to simplify it so the user needn't go any further than to type the name of the script and the name of the file they want to strip.
The script is called degimp. Code follows. Code:
#!/bin/bash -i Code:
file1="$1" Carver |
Code:
$./FileName argument argument Code:
Code:
userx@voided1.what~>> ./xtest textCattwo |
Code:
#!/bin/bash |
if you want to do more error checking, say for the proper file type.
Code:
#!/bin/bash Code:
userx@voided1.what~>> ./xtest textCattwo.oop note to @c0wb0y make that one a one liner. :D |
@c0wb0y
I had to fix your code, I just added mine to yours before checking yours. Code:
userx@voided1.what~>> ./xtest textCattwo.mkv Code:
#!/bin/bash |
I know. Those damn extra double quotes and $ sign. These fat fingers. :)
|
Quote:
Code:
userx@voided1.what~>> ./xtest Pitch.Perfect.2.2015.720p.mp4 Code:
#!/bin/bash Just a date format issue NBD, I changed it to this Code:
-ModifyDate="$(date +%F%T)" $1 <-- exiftool needs file name last to process it. Code:
userx@voided1.what~>> ./xtest Pitch.Perfect.2.2015.720p.mp4 Code:
Code:
userx@voided1.what~>> ./xtest Pitch.Perfect.2.2015.720p.mp4 now if he, the OP can figure all of this out, that'd be a good thing. :D :D |
Thanks for all the help and suggestions...
After a little more Google-ing and getting friendly with Stack Exchange, I came up with this re-edit of my original script:
Code:
#!/bin/bash I have yet to test the Your file is not in this directory. Which seems unnecessary since the user is naming the file to be de-gimp'ed. I may just edit it out. That sort of thing fits better with a "while read line" kind of loop, which was what I was trying to get away from. I kept the original script in my execution path, of course and renamed it degimp2. degimp seems more appropriate for the one where the filename follows the command to start the script. I was surprised to not get any bash error messages. I guess the changes I made were up to spec for bash 4.3. Carver |
Hah! Problem with me writing on-the-fly and not reading what those arguments for.
Code:
#!/bin/bash |
Quote:
|
I like Cowboy's script the best but why oh why is it all in one line?
To save space? |
Quote:
|
Quote:
|
Quote:
|
Quote:
Eh, and I'd need one of those super wide screens to fit that in one line in a text editor. Hehe. |
All times are GMT -5. The time now is 07:36 PM. |