Identify command to output to Variable
Posted: 2010-12-28T13:04:40-07:00
I'm so close, but the syntax must be off. I'm using the identify command to see the height & width of an image. I then need to see that as a variable so that it can be processed by an If/Then statement. I've tried the following things but they are all wrong. Does anyone know how to output the height & width (separately) so that I can process it with conditional logic?
Code: Select all
#!/bin/bash
identify sand.jpg -format "%f,%w,%h"
echo %w
Code: Select all
#!/bin/bash
identify sand.jpg -format "%f,%w,%h"
echo $%w
Code: Select all
#!/bin/bash
identify sand.jpg -format "%f,%w,%h"
echo $(%w)
Code: Select all
#!/bin/bash
identify sand.jpg -format "%f,%w,%h"
echo $(w)
Code: Select all
#!/bin/bash
identify sand.jpg -format "%f,%w,%h" > $newVariable
echo$newVariable
Code: Select all
#!/bin/bash
newVariable=identify sand.jpg -format "%f,%w,%h"
echo$newVariable