[Ilugc] some shell script samples

  • From: lug@xxxxxxxxxxxxxxxxxx (Chandrashekar Babu)
  • Date: Thu, 27 Dec 2012 10:17:45 +0530

Hi, 

 
 Also, if the script is being invoked from inside a login shell, then there
 is a bright chance the 'ls' will be aliased (I usually alias my ls to show
 file size) and this will fail in weird ways.

Good point. BTW, the original code snippet posted by OP will not work
as `ls /etc` will only return list of file names and not expand to their full
path.

The most common mistakes by amateur shell script programmers are
unnecessary usage of 'ls' and 'cat' commands in their scripts.

-- 
Chandrashekar Babu.
http://www.chandrashekar.info/

Other related posts: