![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Associated array from command line options | jperret | Shell Programming and Scripting | 1 | 01-10-2008 02:16 PM |
| launch a command only if | Minguccio75 | UNIX for Advanced & Expert Users | 10 | 02-16-2007 04:48 AM |
| Split Command options | mohdtausifsh | UNIX for Advanced & Expert Users | 7 | 10-04-2006 04:28 AM |
| replacing a string in a file with command line parameter | chiru_h | Shell Programming and Scripting | 5 | 08-03-2006 06:34 AM |
| Executing command line options | Safia | High Level Programming | 8 | 07-04-2002 12:50 AM |
|
|
Submit Tools | LinkBack | Thread Tools | 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"
|
| Forum Sponsor | ||
|
|
|
#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 Code:
dhummy=`some "command" --with options` Code:
fnord='some "command" --with options' eval $fnord |
|
#3
|
|||
|
|||
|
because I get this as the output:
Quote:
|
|
#4
|
|||
|
|||
|
anyone know why this is failing?
|
|
#5
|
|||
|
|||
|
requesting help again, thanks!
|
|
#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? |
|||
| Google The UNIX and Linux Forums |