[GTALUG] Bash Problem

William Park opengeometry at yahoo.ca
Sun Jan 8 10:37:17 EST 2017


Hmm... yes.  Now that you mention it, the quoting here is unnecessary,
because it's variable assignment and further splitting is not done.
-- 
William

On Sun, Jan 08, 2017 at 01:28:03PM -0200, Mauro Souza wrote:
> Or
> nFname="${base}.mp4"
> 
> Using brackets you can mix variables and text and create something like
> this:
> newName="${oldname}-bkp-${filedate}.${extension}.old"
> 
> Mauro
> http://mauro.limeiratem.com - registered Linux User: 294521
> Scripture is both history, and a love letter from God.
> 
> 2017-01-08 13:21 GMT-02:00 William Park via talk <talk at gtalug.org>:
> 
> > On the topic of quotes, see my in-line comments...
> >
> > On Sun, Jan 08, 2017 at 05:57:40AM -0500, Stephen via talk wrote:
> > > On 2017-01-07 07:25 PM, Stephen via talk wrote:
> > > > #!/bin/bash
> > > > # Usage: convert file to mp4
> > > > shopt -s nullglob
> > > > ext='.mp4'
> > > > for f in *.mkv
> > > > do
> > > >    base=$(basename $f .mkv)
> >
> > Should be
> >     base=$(basename "$f" .mkv)
> >
> > > >    nFname=$base".mp4"
> >
> >     nFname="$base".mp4
> >
> > > >    echo $nFname
> > > >    avconv "-i $f -c:v libx264 -c:a copy $nFname"
> >
> >     avconv -i "$f" -c:v libx264 -c:a copy "$nFname"
> >
> > > > done
> > >
> > >
> > > Thank you for the replies. Simply removing the quotes did the trick! :)
> > ---
> > Talk Mailing List
> > talk at gtalug.org
> > https://gtalug.org/mailman/listinfo/talk
> >


More information about the talk mailing list