Re: script line not working as its supposed to, but why?

2013-12-13 Thread Darac Marjal
On Wed, Dec 11, 2013 at 01:44:51PM +, Sharon Kimble wrote: On Wed, 11 Dec 2013 12:42:51 +0100 Gian Uberto Lauri sa...@eng.it wrote: Sharon Kimble writes: But there is no consistency with the creation date, the menu itself is regenerated whenever I install a new programme, and the

script line not working as its supposed to, but why?

2013-12-11 Thread Sharon Kimble
I have this line in a bash script that is not doing what its supposed to - 'find /home/boudiccas/.fluxbox -type f -mtime +$num -name 'menu-*' -delete' where $num = 7 and 'menu-*'=menu-20131209-11:05 . Obviously the date and time can be different in each case, so how do I get it so that it deletes

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Scott Ferguson
On 11/12/13 21:45, Sharon Kimble wrote: I have this line in a bash script that is not doing what its supposed to - 'find /home/boudiccas/.fluxbox -type f -mtime +$num -name 'menu-*' -delete' where $num = 7 and 'menu-*'=menu-20131209-11:05 . Obviously the date and time can be different in

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Gian Uberto Lauri
Sharon Kimble writes: I have this line in a bash script that is not doing what its supposed to - 'find /home/boudiccas/.fluxbox -type f -mtime +$num -name 'menu-*' -delete' where $num = 7 and 'menu-*'=menu-20131209-11:05 . Obviously the date and time can be different in each case, so

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Sharon Kimble
On Wed, 11 Dec 2013 21:58:19 +1100 Scott Ferguson scott.ferguson.debian.u...@gmail.com wrote: On 11/12/13 21:45, Sharon Kimble wrote: I have this line in a bash script that is not doing what its supposed to - 'find /home/boudiccas/.fluxbox -type f -mtime +$num -name 'menu-*' -delete'

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Sharon Kimble
On Wed, 11 Dec 2013 12:09:18 +0100 Gian Uberto Lauri sa...@eng.it wrote: Sharon Kimble writes: I have this line in a bash script that is not doing what its supposed to - 'find /home/boudiccas/.fluxbox -type f -mtime +$num -name 'menu-*' -delete' where $num = 7 and

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Gian Uberto Lauri
Sharon Kimble writes: But there is no consistency with the creation date, the menu itself is regenerated whenever I install a new programme, and the old menu is saved with the suffix of the date and time. I want to delete the 'menu-*' files if there are more than 7, and the command is

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Sharon Kimble
On Wed, 11 Dec 2013 12:42:51 +0100 Gian Uberto Lauri sa...@eng.it wrote: Sharon Kimble writes: But there is no consistency with the creation date, the menu itself is regenerated whenever I install a new programme, and the old menu is saved with the suffix of the date and time. I

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Mathias Bauer
* Gian Uberto Lauri wrote on 2013-12-11 at 12:42 (+0100): Sharon Kimble writes: I want to delete the 'menu-*' files if there are more than 7, and the command is parsed when I have 'set -x' at the head of the script but this line does nothing! It runs but doesn't achieve anything. I

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Gian Uberto Lauri
Sharon Kimble writes: ++ wc -l ++ ls -1 'menu-*' ls: cannot access menu-*: No such file or directory + '[' 0 -gt 7 ']' I fear that you should either 'cd' to the directory (~/.fluxbox I suppose) you want to clear before running my code or change it this way if [ `ls -1

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Sharon Kimble
On Wed, 11 Dec 2013 15:19:22 +0100 Mathias Bauer mba...@gmx.org wrote: LC_ALL=C ls menu-* | head -n -7 | xargs -r rm Thank you Mathias, I incorporated the line above into the script and it works beautifully, thanks. :) I'll also have a look at the bash tutorials that you posted because I know

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Gian Uberto Lauri
Mathias Bauer writes: head -n -7 That's the option I did not recall :) Nice job. -- /\ ___Ubuntu: ancient /___/\_|_|\_|__|___Gian Uberto Lauri_ African word //--\| | \| | Integralista GNUslamicomeaning I

Re: script line not working as its supposed to, but why?

2013-12-11 Thread Scott Ferguson
On 11/12/13 22:14, Sharon Kimble wrote: On Wed, 11 Dec 2013 21:58:19 +1100 Scott Ferguson scott.ferguson.debian.u...@gmail.com wrote: On 11/12/13 21:45, Sharon Kimble wrote: I have this line in a bash script that is not doing what its supposed to - 'find /home/boudiccas/.fluxbox -type f