Tech Space

Experiencing Tech as a Professional Techie

(g)awk script to remove last dir from PATH

Posted on | April 26, 2007 | No Comments

This script chops off the last dir off of the PATH (still need to assign back to PATH)


echo $PATH | gawk -F':' '{
for(i=1; i<NF; i++) {
if(i) {
printf (":");
}
printf("%s", $i);
}
}'
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Live
  • StumbleUpon
  • Tumblr
  • TwitThis
  • FriendFeed
  • Netvibes
  • Ping.fm
  • Posterous
  • Technorati
  • Tipd
  • Twitter
  • Yahoo! Buzz

Comments

Leave a Reply





CommentLuv Enabled