Monday, November 19, 2007

Simple But intriguing

1) How does one create a file starting with hyphen(-)?
2) How does one remove a file starting with hyphen(-)?


My Solution
===========
1)
bash-2.05$touch a
bash-2.05$tar cvf -c.tar a
2)bash-2.05$ rm ./-c.tar

1 comment:

Girish said...

standard interview question.

scripting errors can generate such files. we have an unwritten rule. always use absolute path names. :)