|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to? launch command with string of command line options
my description from another thread... Quote:
Code:
#!/bin/bash
IFS=$'\n'
function OutputName() {
input=$1
echo $input
input=`echo "$input" | sed -e 's/.[Aa][Vv][Ii]//'`
input=`echo "$input".avi`
output_name=$input
}
if [[ -z "@ARGV" ]]; then
echo "arguements are files to combine"
exit
else
if [[ ! -e $1 ]]; then
echo "no such input video!"
exit
else
first=`find "$1" -printf "%f"`
echo "Input File Found!: $first"
shift
fi
OutputName $first
echo "Output video name will be: "$output_name""
echo
fi
options="--audio-map --force-b-frame --force-unpack --rebuild-index"
appendlist=""
until [ -z "$1" ]
do
# echo "$1"
# echo "$appendlist"
if [[ ! -e $1 ]]; then
echo "no such input video! $1"
exit
else
filename=`find "$1" -printf '"%f"'`
appendlist="$appendlist $options --append $filename"
fi
# echo "$appendlist"
# echo
shift
done
echo "avidemux2_cli --nogui $options --load \"$first\" $appendlist --force-smart --save \"$output_name\" --quit"thanks for the help! |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
I didn't read your code too carefully, so I could have missed something, but is there anything wrong with Code:
echo 'some "command" --with options' | sh You can have your variants, of course. Code:
dhummy=`some "command" --with options` Code:
fnord='some "command" --with options' eval $fnord etc etc. |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
because I get this as the output:
Quote:
|
|
#4
|
|||
|
|||
|
anyone know why this is failing?
|
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
requesting help again, thanks!
|
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
How exactly did you manage to produce that error message? It looks like you had double-quoted the whole command, where you shouldn't.
If you change it back to echo, doesn't ../combine-0.1 | sh do what you want? |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running set options from the command line and bash command | Straitsfan | UNIX for Dummies Questions & Answers | 5 | 07-28-2011 11:27 AM |
| awk script file command line options | tomr2k | Shell Programming and Scripting | 2 | 06-30-2011 02:55 AM |
| Using perl to get options from command line | Damon_Qu | Shell Programming and Scripting | 1 | 07-01-2010 10:17 PM |
| Associated array from command line options | jperret | Shell Programming and Scripting | 1 | 01-10-2008 04:16 PM |
| Executing command line options | Safia | Programming | 8 | 07-04-2002 03:50 AM |
|
|