Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    Apart from $FILE (line 17) which maybe changed to $FIL, can you describe better the problem you're having (if your script is not working)? Commented Jun 3, 2016 at 8:18
  • Thanks for the correction. My problem is that I need to SORT all the files within the folders. There's like 2000 directories and I need to loop through them and then loop through all files within these dirs and sort them by extension in directory which will be created (or files will be moved) and it's name will be that particular extension Problem is that '6 for DIRE in "$(ls -d $tar_fol"*")" giving me an error Commented Jun 3, 2016 at 8:21
  • Please provide a sample of the directory structure used as input and the expected output. Commented Jun 3, 2016 at 8:29