Announcement

Collapse
No announcement yet.

Command line trash bin access

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: Command line trash bin access

    Originally posted by olembe
    Telengard: that's a great addition! I've added it to my script now.
    Do you mean this? I'm not sure because you didn't quote the part you're talking about.

    Code:
    #! /bin/bash
    
    kfmclient move $@ "trash:/"
    echo Moved to trash bin:
    for filename in $@
     do echo $filename
    done
    It echoes back what was passed on the command line, which is useful if you want to see how variables and wild-cards are expanded. I think it would be more useful to report files which were actually moved to trash.
    Welcome newbies!
    Verify the ISO
    Kubuntu's documentation

    Comment


      #17
      Re: Command line trash bin access

      I found that the script I was using had trouble for filenames containing spaces. The fix was to use quotes around variable names. Just in case anyone else tries to use the script I posted, here's the latest:

      Code:
      #! /bin/bash
      
      for fileName in "$@"
       do kfmclient move "$fileName" "trash:/" && echo "trashed \`$fileName'"
      done
      In this version, each filename is echoed only if the kfmclient move command succeeds.
      Welcome newbies!
      Verify the ISO
      Kubuntu's documentation

      Comment

      Working...
      X