Jump to content

nirvanaforu

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nirvanaforu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi All: I would like to write a small shell script to be added to cronjobs, the main purpose is for the shell script is to delete the outdated files and outdated sub-directories under a certain folder, however I do not want to delete the top folder. For example: the top folder is /proj/tmp the command I wrote was: “ find /proj/tmp/ -mtime +10 | xargs rm -rf ” The problem is: once there are some files inside satisfying the find condition, "/proj/tmp/" will be returned as well. I can't add -type f, because I would like to remove those subfolders as well. if I revise the command as the following: “ find /proj/tmp/* -mtime +10 | xargs rm -rf ” it works as I expected. However, as the top folder is empty, it always report some errors like: "find /proj/tmp/*: no such file or directory". If it's added to cronjob, which will be emailed to root again and again. Any suggestions to this problem? Thanks a lot!!! btw: I tried with >/dev/null, which didn't help with the error message. Someone suggested tmpwatch, the problem is that I don't know which files or directories returned by tmpwatch, so that I can't test with tmpwatch.
  2. Thanks, man. That's what I'm looking for, coma , haha however, as I just tested, print won't accept coma-separated lists. That's the only differences I know about print and echo now..
  3. yes, I'm using <?php ............?> actually. Thanks
  4. Hi revraz: sure, I know that echo $a+$b without the double quote will work. However, if the string and numbers are mixed if there is some operator to that. For example: <? $a=1; $b=2; echo "the sum is ". $a+$b . "\n"; ?> unfortunately, the '.' operator can't connect string with the result of numbers? I don't want to use two echos to ouput this sentence. Do you know what I'm talking about? Thanks
  5. Hi there, I have a really simple question: how coud I print or echo the result of some arithmetric equations? what's the correct syntax? For example: <? echo "2+3";?> will output the string '2+3' but if I have two variables $a and $b, which $a=2, $b=3 now <? echo "$a+$b"?> will output "2+3" how could I get 5 except using another variable to store the sum first? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.