Bash function not working…
Paul Smith
paul at mad-scientist.net
Tue Jan 8 16:42:59 UTC 2013
On Tue, 2013-01-08 at 11:35 -0500, Tom H wrote:
> On Tue, Jan 8, 2013 at 11:04 AM, JD <jd1008 at gmail.com> wrote:
> > On 01/08/2013 08:38 AM, Johnny Rosenberg wrote:
> >>
> >> I defined the following function in .bash-functions (which is called
> >> from .bashrc):
> >>
> >> speltid () {
> >> ffmpeg -i $1 2>&1 | \
> >> grep Duration | \
> >> awk -F , '{print $1}' | \
> >> sed 's/^.*Duration/Speltid/' | \
> >> sed 's/\./,/'
> >> }
> >
> > For starters, you have a coma after -F
> > bad syntax.
> > But I tried it without that coma (interactively)
> > and it kills the shell.
>
> Either
> -F ","
> or
> -F,
Still no. See my previous email.
If these changes are actually making any difference whatever on your
systems you must be using a seriously bizarre (and non-standard) shell.
$ echo "hi there, you" | awk '{print $1}'
hi
$ echo "hi there, you" | awk -F , '{print $1}'
hi there
$ echo "hi there, you" | awk -F, '{print $1}'
hi there
$ echo "hi there, you" | awk -F "," '{print $1}'
hi there
More information about the ubuntu-users
mailing list