1. Create a directory "preFinal" in your home directory. In case that such directory exist, rename the existing one into "preFinal.000" and then create empty directory preFinal. While renaming existing preFinal into preFinal.000 you may discover that preFinal.000 also exists, so it needs to be renamed into preFinal.001 and so on.
2. Create empty files "a", "b", "c", etc in directory preFinal in the amount that match the number of directories preFinal*
1. Assume there are no directories preFinal* in your $HOME (very first run of the script). It will create directory preFinal and will create empty file "a" in it.
2. Second run of the same script will result in renaming preFinal into preFinal.000 and creating empty files "a" and "b" in preFinal. At the end of this run you will have empty file "a" in preFinal.000 and empty files "a" and "b" in preFinal
3. The 3rd run of the scrip will result in empty files "a","b","c" in preFinal, files "a","b" in preFinal.000 and "a" in preFinal.001
4. and so on
Write a shell script capable of doing the following:
Joined: Apr 2013
2013-04-29 03:38 Post: #1
Joined: May 2009
Location: Christchurch NZ
2013-04-29 04:19 Post: #2
Why should I wrote such a script?
What has this to do with xbmc?
If I have helped you or increased your knowledge, click the 'thank user' button and increase my reputation :)
Joined: Oct 2009
2013-04-29 16:48 Post: #3
That's a simple programming 101 assignment. Things you should ask in this assignment:
What should you use/do after you use the z character?
What feedback mechanism should you use (log file/on screen/?) if there's a problem, IE permissions.
And, no, I won't write it for you.