Home > Archive > Linux/Unix > November 2004 > awk question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author awk question
smrkdown

2004-09-09, 7:13 pm

How would I print all but the last field in an argument?

Like if the user input is an absolute path to a file like:

/usr/local/etc/test.conf

The / is the field separator. How would I extract /usr/local/etc/ out of that? I also want to account for the fact that they may enter a shorter or longer path which may contain more than four fields.
Variable

2004-11-16, 11:57 am

why not just use basename or dirname.
man dirname
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2009 examnotes.net