Sponsored Content
Top Forums Shell Programming and Scripting Help need to make a shell script run for ffmpeg vhook watermaking in shell Post 302240837 by wingchun22 on Friday 26th of September 2008 06:04:45 PM
Old 09-26-2008
Help need to make a shell script run for ffmpeg vhook watermaking in shell

i have a small problem getting a batxh shell script to run in shell

this is the code

Quote:
#!/bin/bash
echo "flv-watermarker converter"
vhook='/usr/local/cpffmpeg/lib/vhook'
output='/var/www/vhosts/mysite.com/httpdocs/con'
fonts='/usr/share/fonts/TrueType'
text='MYSITE.COM'
echo "$vhook - $output - $fonts - $text"
if (($# ==0))
then
echo "Usage: flvwatermarker [flv files] ..."
exit
fi
while (($# !=0 ))
do
ffmpeg -i $1 -sameq -vhook '$vhook/drawtext.so $fonts/Verdana.TTF -t $text -x 5 -y 5' $output/${1%.*}.flv
shift
done
echo "Finished with flv-watermarker converter"

the problem seems to be centered around the ffmpeg command, something maybe to do with the ' ' wrapping around the vhook part command

this is a strange problem , if i take the ffmpeg command and run it directly from the shell promt it works, but inside this shell script it always seems to stop working around the ffmpeg part

i have other simlier shell scripts without the ' ' wrapping around parts of the ffmpeg command and they work fine, just this one seems to not work at all, i have tried adding " " to wrap the hole ffmpeg command, remove the ' ' from the vhook part, but it does not seem to work for me

i'm new to shell scripting and unix, any help or advise as to way this is not working whould be very usefull, thanks in advance

ps this was the orgianl script before i moved some commands into variables, on the ffmpeg line, to stop that long line always breaking onto two lines in nano

Quote:
#!/bin/bash
echo "flv-watermarker converter"
if (($# ==0))
then
echo "Usage: flvwatermarker [flv files] ..."
exit
fi

while (($# !=0 ))
do

ffmpeg -i $1 -sameq -vhook '/usr/local/cpffmpeg/lib/vhook/drawtext.so /usr/share/fonts/TrueType/Verdana.TTF -t MYSITE.COM -x 5 -y 5' /var/www/vhosts/mysite.com/httpdocs/con/$1.flv

shift
done
echo "Finished with flv-watermarker converter"

Last edited by wingchun22; 09-26-2008 at 07:11 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run unix commands in a new shell inside a shell script?

Hi , I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell. So scenario is that - I need to have one shell script which is ran as a part of crontab - in this shell script I need to do a... (2 Replies)
Discussion started by: hkapil
2 Replies

2. Shell Programming and Scripting

How to Run a shell script from Perl script in Parent shell?

Hi Perl/UNIX experts, I have a problem in running a shell script from my perl script (auto.pl). I run the perl script using perl auto.pl from the shell prompt The shell script picks the files in "input" folder and procesess it. The shell script blue.sh has this code. export... (16 Replies)
Discussion started by: hifake
16 Replies

3. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies

4. Shell Programming and Scripting

please help me: how to make Ln in script shell

please can u help me in my homework, i want to creat a script shell for ln (symbolik link). This script will do everything that Ln do it. (1 Reply)
Discussion started by: halo03
1 Replies

5. Shell Programming and Scripting

[How To?] Run shell script and get output into another shell.

Hi guys, I have a simple question, I want to store the output of the following command: As you can see it is running all the time, and we get a new line every 3sec. I just want to store these new lines into a single variable, so I can use it into a script. To clear the screen, and... (4 Replies)
Discussion started by: Thireus
4 Replies

6. Shell Programming and Scripting

how we can make shell script not to run

Hi,shell script is scheduled from maestro and we want mastero should not run shell script so can we edit the shell script so that it should run.ThanksPrakash (5 Replies)
Discussion started by: prakashdba2010
5 Replies

7. Shell Programming and Scripting

How to make a bash or shell script run as daemon?

Say i have a simple example: root@server # cat /root/scripts/test.sh while sleep 5 do echo "how are u mate" >> /root/scripts/test.log done root@server # Instead of using rc.local to start or another script to check status, I would like make it as daemon, where i can do the following: ... (2 Replies)
Discussion started by: timmywong
2 Replies

8. Shell Programming and Scripting

To run a local shell script in a remote machine by passing arguments to the local shell script

I need to run a local shell script on a remote machine. I am able to achieve that by executing the command > ssh -qtt user@host < test.sh However, when I try to pass arguments to test.sh it fails. Any pointers would be appreciated. (7 Replies)
Discussion started by: Sree10
7 Replies

9. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies
escape(1)							Mail Avenger 0.8.3							 escape(1)

NAME
escape - escape shell special characters in a string SYNOPSIS
escape string DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result. EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string: $ var='; echo gotcha!' $ eval echo hi $var hi gotcha! $ Using escape, one can avoid executing the contents of $var: $ eval echo hi `escape "$var"` hi ; echo gotcha! $ A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient: #!/bin/sh formail -x to -x cc -x resent-to -x resent-cc | fgrep "$1" > /dev/null && exit 0 echo "<$1>.. address does not accept blind carbon copies" exit 100 To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt script: bodytest reject_bcc `escape "$RECIPIENT"` SEE ALSO
avenger(1), The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 escape(1)
All times are GMT -4. The time now is 04:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy