Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to iterate file list of subdirectory

 
manoj r patil
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have one script which processes files one by one. I want to automate this to process all the files in one subdirectory. So I tried the following script buts its giving me error 'ls: invalid option -- 2'



Any idea what am I doing wrong here?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just out of curiosity, was it necessary to be so complicated?

Try this instead:
 
manoj r patil
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want file names and this will give me path along with file name like

Tim Holloway wrote:Just out of curiosity, was it necessary to be so complicated?

Try this instead:
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
S. Nitesh
Ranch Hand
Posts: 36
1
Chrome Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try this...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic