Tuesday, March 15, 2011

DOS - Batch programming - Accept command input for batch programm

hello.bat file content
@echo welcome %1 %2 %3 %4 boy

Execution.
hello one two three four

output will be
C:\Documents and Settings\retheesh\Desktop>hello one two three four (Input parameters)
welcome one two three four boy

Friday, March 04, 2011

perl oneliners

perl -p -i -e 's/oldstring/newstring/g' filename.
This will change the oldstring to newstring in the file.



Perl oneliner to install modules. (Note should have internet access and should have CPAN configuration done)


perl -MCPAN -e 'install HTML::Template'
                 OR

cpan -i 'install HTML::Template'



SED one Liner