Remove Empty Lines and Comments
Tagged with: comments, commnad, delete, Linux, sed
Tuesday, February 12th, 2008 11:27 PM
Remove comments and blank lines from example.pl
sed '/ *#/d; /^$/d' example.pl
Remove comments and blank lines from example.pl
sed '/ *#/d; /^$/d' example.pl
Execute a command and get its results using python in Linux
import commands
result = commands.getoutput("ls")