Hey wassup
There are a few potential issues with using ls (although possibly not here). The one issue I can see though is that your ls will
make no distinction between files and directories, so assuming you only want directories it will fail.
This is a better start and if you run it on the command line you will see that you also get the folder names (hint)
Quote:
grep "http://" /folder/name.txt | sed 's/^.*http:/http:/' | sed 's/\s.*$//' | sort
|
Here I will be a little harsher and say why??? Now I realise you are newish so the reason for the why is because sed can search just like grep can
so it is a waste to have it in there. Also, maybe you could show us a before and after of the line you want as the sed's seem quite over the top as well.
Quote:
The thing that stumps me is how to do the loops.
|
Lastly, go to your favorite source for bash (I like
this one) and look up either a for or while loop