Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Removal of stone age relics

  1. #1
    Join Date
    Nov 2009
    Location
    NS, Canada
    Beans
    127
    Distro
    Ubuntu 18.04 Bionic Beaver

    Removal of stone age relics

    i am just thinking out loud about a LinuxStone_Age-Relic that needs to be polished.

    I think most of us have slipped in to the naming convention for files and directories of writing in recognizable plain text.
    eg.
    Code:
    This Song.mpg
    or a directory. called
    Code:
    My Songs Dir
    from the desktop almost everything can be done to this file or dir. Almost.
    Some times the command line is needed
    Code:
    sudo chown xxx My Songs Dir
    Linux falls over because it can not handle separate words as a name.

    Do you think that this feature, wanted or forgotten, will be updated?
    Lenovo D30 Workstation,128GB ram, Nvidia K4000, 2xDell U2312HM, Ubuntu Studio 16.04 LTS LWKS 14.0, Lightworks Keyboard

  2. #2
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Removal of stone age relics

    You can use any of these options

    1. backslash escaping
    Code:
    sudo chown xxx My\ Songs\ Dir
    2. single quotes
    Code:
    sudo chown xxx 'My Songs Dir'
    3. double quotes
    Code:
    sudo chown xxx "My Songs Dir"
    Double quotes allow parameter expansion e.g.

    Code:
    sudo chown xxx "My Songs Dir/*.mp3"
    whereas single quotes treat everything them as literal. Tab completion makes escaping spaces particularly painless.

  3. #3
    Join Date
    Dec 2010
    Beans
    Hidden!

    Re: Removal of stone age relics

    Quote Originally Posted by steeldriver View Post
    Tab completion makes escaping spaces particularly painless.
    Tab complete FTW!

  4. #4
    Join Date
    Aug 2013
    Beans
    12

    Re: Removal of stone age relics

    Quote Originally Posted by not found View Post
    Tab complete FTW!
    +1 to that!

    I think it comes down to familiarity. Sure, the issue you describe is less-than-ideal, but once you're comfortable with workarounds like tab-complete, or backslash delimiting, the terminal can be very efficient. Personally, I've found that it's easier than trying to point-and-click everything if you're moving large numbers of files around. You do have to be careful with commands like mv and rm though, as I'm not aware of any undo switch or Rubbish Bin if you accidentally delete something via the terminal - though I could be mistaken!

  5. #5
    Join Date
    Nov 2011
    Beans
    2,336
    Distro
    Ubuntu

    Re: Removal of stone age relics

    The alternative is always treating arguments with spaces as if they are always escaped. That doesn't work when you want the arguments treated individually. So, you would need to escape, or otherwise qualify them, in some manner, when you did.

    In the end, it's a wash.

  6. #6
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Removal of stone age relics

    Quote Originally Posted by ralph-beeby View Post
    +1 to that!

    I think it comes down to familiarity. Sure, the issue you describe is less-than-ideal, but once you're comfortable with workarounds like tab-complete, or backslash delimiting, the terminal can be very efficient. Personally, I've found that it's easier than trying to point-and-click everything if you're moving large numbers of files around. You do have to be careful with commands like mv and rm though, as I'm not aware of any undo switch or Rubbish Bin if you accidentally delete something via the terminal - though I could be mistaken!
    To allow for second thought I use aliases to add the -i option (interactive) for cp, mv and rm in my .bash_aliases file to make them all safer, eg alias cp='cp -i'

    Then if I attempt to copy a file which will overwrite another file of the same name, the terminal will ask if I want to continue, allowing me to investigate further before doing something I might regret later. Similarly for mv and most importantly rm; once you have rm'd a file it is gone.

  7. #7
    Join Date
    Jun 2008
    Location
    Tennessee
    Beans
    3,421

    Re: Removal of stone age relics

    If there's a command line interpreter out there that can deal with spaces in a file name without escaping or quoting, I'm not aware of it. It's the nature of the beast.

  8. #8
    Join Date
    Nov 2009
    Location
    NS, Canada
    Beans
    127
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Removal of stone age relics

    Quote Originally Posted by steeldriver View Post
    You can use any of these options

    1. backslash escaping
    Code:
    sudo chown xxx My\ Songs\ Dir
    2. single quotes
    Code:
    sudo chown xxx 'My Songs Dir'
    3. double quotes
    Code:
    sudo chown xxx "My Songs Dir"
    Double quotes allow parameter expansion e.g.

    Code:
    sudo chown xxx "My Songs Dir/*.mp3"
    whereas single quotes treat everything them as literal. Tab completion makes escaping spaces particularly painless.
    Thanks
    I got into the habit of just cuting & pasteing into a terminal, I can't remember if I forgot this or never knew it.

    I think it would be better if some of the old code was brought up to date.
    Lenovo D30 Workstation,128GB ram, Nvidia K4000, 2xDell U2312HM, Ubuntu Studio 16.04 LTS LWKS 14.0, Lightworks Keyboard

  9. #9
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Removal of stone age relics

    Quote Originally Posted by uwe-bungto View Post
    I think it would be better if some of the old code was brought up to date.
    So... let me play devil's advocate here

    Code:
    $ mkdir tests
    
    $ touch tests/file tests/file\ -al
    
    $ ls tests
    file  file -al
    Now, what do you expect to be the result of

    Code:
    $ ls tests/file -al
    ? The point being that there needs to be some agreed delimiter (or field separator) in order for the command to be broken into lexical units - if not whitespace then what?

  10. #10
    Join Date
    Nov 2011
    Beans
    2,336
    Distro
    Ubuntu

    Re: Removal of stone age relics

    Just occurred to me that if someone took the notion of removing this 'relic' seriously, they would need to rewrite Bash, rewrite every tool that depends on Bash to parse its command line arguments, and also cope with the blowback for forcing rewrites of a significant majority of all Bash scripts ever written.

    Such things help explain why software is a conservative affair.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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