Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15
Ok I'm gonna try that one, thank you . As for the joke, I just didn't get it ....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429

    Ok I'm gonna try that one, thank you . As for the joke, I just didn't get it .
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

  2. #12
    Banned CodeRoot's Avatar
    Join Date
    Sep 2005
    Posts
    567
    Quote Originally Posted by borromini
    As for the joke, I just didn't get it .

  3. #13
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    Ok, proud to present the solution . I found out an if/else construct does the trick:

    Code:
    if ls -l | grep "totaal 0"
    returns the wanted output => if the directory is empty, it will echo that, if not, it will clean it up .
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

  4. $spacer_open
    $spacer_close
  5. #14
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Code:
    if [ $(ls | wc -l) -eq 0 ]
    is another way to do what you want.

  6. #15
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    Thanks, that goes into my bash snippets list .
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •