
March 8th, 2009, 12:20 AM
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 3
Time spent in forums: 1 h 7 sec
Reputation Power: 0
|
|
|
Shell script not setting variables
I'm /bin/sh as the shell for this script. I'm attempting to create a script that will automate the ripping of DVDs into a format to be named later. So far, I'm able to take the output of Mplayer/mencoder and create a file called "crop.txt".
when I run the script, though, crop.txt is created, but the variables I want to set don't get set...
what am I doing wrong? I'm sure it's something very minor...
-------------------------------------------------------------------------------------------------------------
#!/bin/sh
mplayer -v -ss 00:15:00 -frames 20 -vf cropdetect dvd://1 > crop.txt
CROP='tail -n 11 crop.txt | grep CROP | cut -d= -f2 | cut -c 1-11'
-------------------------------------------------------------------------------------------------------------
now, I've run these commands independently, and the output from
"tail -n 11 crop.txt | grep CROP | cut -d= -f2 | cut -c 1-11"
is "720:480:0:0". I want this set as $CROP, so that later in the script, I can call that variable.
Any assistance is greatly appreciated...
Please keep the scope to only /bin/sh. I have no interest in using csh, bash, or anything like that... /bin/sh is ubiquitous to all UNIX systems.
Bryan
Last edited by brakeb : March 8th, 2009 at 12:29 AM.
Reason: added notification
|