Article 4TEKT Processing a wildcard with getopts

Processing a wildcard with getopts

by
GPGAgent
from LinuxQuestions.org on (#4TEKT)
When I pass a wild card parameter, eg M*.mpg to a script on the command line you need to use $@ like this:

Code:for FF in $@;
do echo "FF: $FF";

ffmpeg -ss 0 -y -i $FF ${FF::-4}.mpg;
done;
exit 0But I can't work out how to use this technique with getopts
Code:while getopts "a:m:" opt; doThis processes -a 1 and does ssomething with it, what that is doesn't really matter here.

What I would like to do is something like -f M*.mpg -w -b 1000k

where -f is a file or files -w will process as widescreen (16:9) and -b is video bitrate.
And the getopts line is this:
Code:while getopts "a:m:" opt; do, so I need some code to extract M*.mpg or the $@ equivalent.latest?d=yIl2AUoC8zA latest?i=whmlPW5elks:WHHGFVMAvmE:F7zBnMy latest?i=whmlPW5elks:WHHGFVMAvmE:V_sGLiP latest?d=qj6IDK7rITs latest?i=whmlPW5elks:WHHGFVMAvmE:gIN9vFwwhmlPW5elks
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments