Programming :: How To Get Same Script To Remove Weeks 2-5
Oct 11, 2010
I need to write a script which will delete all the previous directories I have created. I have found out how to remove one directory with the following code:find /media/CE40-EB9D -type d -name "week1" -exec rm -rf {} ;but how can I get the same script to remove weeks 2-5?
I'm currently using rsync to backup one drive to another. However, it is not currently set up to delete files if they are deleted from the source directory. I'm looking for a way to tell it to delete a file if it was deleted form the source directory X number of days ago.
Anyway I can do this with rsync or a combo with another backup program?
Code: Package xine-lib-pulseaudio is obsoleted by xine-lib, trying to install xine-lib-1.1.18.1-1.fc12.i686 instead error: not an rpm package umount: /var/tmp/imgcreate-k0CsZq/install_root/var/cache/yum: device is busy. (In some cases useful info about processes that use
"system crash" means that:(1)I can ping it , but can not connect to it (via ssh or http or anything else)(2)the major role of that machine is to run a web application written in java, every 3 weeks(almost that), the users inform us and say they can log in that web application , and we find the situation just like (1) says.When this happen , we can only restart the machine by pushing the power button.(It's sad !)I've try to read all the log files located in /var/log but find nothing interesting.
I use the Avasys pipslite driver for my Epson TX210 printer on Fedora FC12. It worked fine two weeks ago, but now only prints a solid black square for the print area. The printer is fine, as it prints normally under Windows. I rebuilt the driver from source.
I'm using crontab to start and stop music playback (its like start and end of a brake in school). The problem is that some of the entries should be run on even weeks and some on odd. exp:
This should be played on even weeks 00 08 * * * audacious -p 10 08 * * * audacious -u and this on odd 05 08 * * * audacious -p 15 08 * * * audacious -u
There are about 20 entries for even and 20 for odd. I found here on the forum that maybe this should work but for it is not working for me 00 08 * * * [[ $(expr `date +\%W` \% 2) = 0 ]] && audacious -p If I put it like that its not working at all
I have noticed that after 20 days of system up time, the ubuntu is not as fast as the first day.maybe the RAM is polluted with necessary files or there are some unnecessary disk activities.
This is my file, named xxx.c. And there are two functions in it.
[code]...
When I try to compile the whole project, I used -ffunction-sections,-fdata-sections to generate the .o files, use Wl,--gc-sections -Wl,--print-gc-sections to link to the exacutable file. gcc 4.3.2 ld 2.18 Debian 5 After the first time I compiled it, I got a list of Removed functions. But one second later, I rememberd that I forget to close the Compile Switch: Debug. Then I had to recompile it and got another list. Compare these two lists, I found that , bxx isn't on the second list. First I guess that bxx is a debug function but never used in debug mode, and it won't be compiled in release mode. I check the source and find that there was no compile switch for bxx. But it's caller function axx, is removed, both the debug switch is on and off. I try to compiled the project for several times , but the result is the same. I can't realized it , why? Is that the --gc-sections won't remove all the functions not used?
I was preparing a script which will remove all my files from directory which are 24 hour old.I tried some thing like thisfind . ( -name 'log.*' -mtime +1 ) -exec rm {}; but it is throughing error like : missing argument to exec.
I have tried this a million ways, got it to work once but it didn't work sitewide for some reason. I have a url: [URL] and I want it to be found by going to: [URL] I am using this
I am trying to parse some information from a webpage and store the output into an array. Basically i have found using HTML::TokeParser to be useful at stripping out all the html tags, i have one problem with the output though there is 2 occurances of the same "item" within the output.
I am doing a mysql query with a bash shell script like: mysql translator -u root --password=******** -e "SELECT word FROM tagalog ORDER BY RAND() LIMIT 1" | while read line; do echo $line
So when I echo the value of $line I get: word magandang umaga "word" is the name of the row in the table and maganda umaga is a randomly selected choice from the row. Is there a way i can remove the name of the row from the variable $line. With a result that will allow me to echo $line and output only the randomly selected entry in from the row e.g. magandang umaga
Bear in mind that LIBS can be variable, I mean I need to drop any duplicate and only retain the last one of each different entry. And we must keep the order as is, I must not sort out them.
I have a multiple txt file in one folder. I would like to remove everything from starting until find string keyword in one folder. Here is the sample of my text:
this would remove the Last character of the value assigned to the %host%. for example if my value is: abcd i get abc. but i am not able to assign the output. for example when i do
Quote:
set k=`echo %host%|sed "$s/.$//"`
after doing echo %k i get no output at the command prompt...!! whereas when i just type:
Quote:
echo abcd|sed "$s/.$//"
at the command prompt i get abc. maybe some other ways to Remove the Last character...?
I'm having a bit of a headbanger trying to work this one out. I'm trying to remove all of the characters on a line apart from the last 17. For example, I need to change this:
i have a table in a text file. How can i remove from that table for example "SLS= " if the value is empty? Is it possible to do it in bash awk or sed? [URL]
How to remove alternate char from file using shell script? If the file content is "1234567890" the output file should be "24680". sed 's/(.)(.)/2/g' filename Now there may be small modification to generate two alternate byte, what it should be? If the file content is "1234567890" the output file should be "125689".
the preceding and trailing spaces around the commas in my CSV without destroying my address field. I'm new to regex and sed so this is probably easy but I just can't do it without destroying the Address section. I'm using vanilla Linux and sed 4.1.3I'm willing to use any regex or even awk if needed.
Example: I need this randall , dean, 11111 , 1309 Hillside Ave., Warsaw, VA , 23591
I am using 'sed -e /foo/d' to match lines which I want to delete from a file. I discovered I have some lines which contain random (extended?) characters like 'ủ' which I would also like to delete. The lines in the file should only contain alpha numeric characters.