4
2
How can I install awk in this version of Ubuntu 11? I installed it from Ubuntu Software Center and I cannot use it.
I'm trying to run an awk script:
#!/bin/awk
Begin
{
print strftime("ora %H, %M , %S");
}
and I cannot run it because awk is not installed.
./l4p1.sh: /bin/awk: bad interpreter: No such file or directory
It's debatable whether
#!/usr/bin/env awk
is better. It will invoke whicheverawk
command the current user happens to have first in$PATH
. That's usually what you want, but it can cause problems if a particular user has done something odd. – Keith Thompson – 2012-01-15T16:18:27.0932@KeithThompson I understand there could be problems with broken per-user installations, but that should rarely be the case. I'm just used to using
env
, since there are more advantages to it than possible issues. – slhck – 2012-01-15T16:33:28.827