Showing posts with label SED. Show all posts
Showing posts with label SED. Show all posts

Feb 29, 2008

Remove .svn

When we need to remove .svn from each directories in a project (Using Subversion to control code), run following command in Unix/Linux:
$ find . -name .svn -print0 | xargs -0 rm -rf

*Note
using zip to compress file/folder in Unix/Linux

$ zip -r FCH.zip FCH
$ upzip FCH.zip

Sep 18, 2007

Convert string to html table

#!/bin/sh
sed -e '/^[A-Za-z0-9]*[^\:]$/{
d
}' < source_file > tmp_file
echo "<table>" > destination_file.html
sed -e '/:/{
s/^/<tr><td>/g
s/\:/<\/td><td>/g
s/$/<\/td><\/tr>/g
}' < tmp_file >> destination_file.html
echo "</table>" >> destination_file.html