Hot answers tagged ksh
you have a typo on line 8 of your script, it should be: read dirname That's the reason you only get '5' printed, because $dirname is empty. What is happening is that when you do read $dirname the shell expands '$dirname' to it's value which is empty. Also on a side note, always use double-quotes when enclosing variables. Revised script: #!/bin/ksh echo ...
Only top voted, non community-wiki answers of a minimum length are eligible