Add new comment

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Submitted by Jim (not registered) on Fri, 2009-03-13 11:15.

Why the needless obfuscation ?  A user can just "cat" or "head" or "more" the hosts file, instead of using awk string functions.

awk 'NR==3 {print substr($0,1,14)}' /etc/hosts

Awk has its place, but not for looking at one line in a file. This kind of thing will throw beginners.  And why use conditional constructs on the command line, like this:

cd /etc/httpd/conf && cp /etc/httpd/conf/httpd.conf httpd.conf.temp

where just typing the commands is easier ?

cd /etc/httpd/conf

cp httpd.conf httpd.conf.temp

Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.

Reply

*
*
The content of this field is kept private and will not be shown publicly.


*

  • Images can be added to this post.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <div>
  • Lines and paragraphs break automatically.