1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Handling filenames with blanks at command line

Discussion in 'Support' started by BobK, Apr 29, 2013.

  1. BobK

    Joined:
    Sep 11, 2009
    Messages:
    35
    Likes Received:
    0
    I often use the command line to view (read, watch, etc) files by issuing "START fn".

    When the 'fn' is long, I enter it as "START *unique", hit TAB and TC fills in the full name (based on the unique character identifying the file) - with the proper quotes around the filename when there are blanks in the name.

    BUT, upon hitting the enter key, TC opens a new session of TC - title of that filename - but does not start the operation..

    IF I rename the file such that blanks become, say, underscores.. it works as expected. Since TC added those quotes, I assume that the quoted string should have been treated as an complete file than to START..

    Am I missing some understanding or is this a bug in my TC v11.0 ?

    Thanks,
    Bob K.
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Try
    Code:
    start /pgm "filename with spaces"
    Or
    Code:
    start "" "filename with spaces"
    Like a number of other annoyingly dumb features, this syntax is for CMD.EXE compatibility. Being basically lazy, I prefer to

    Code:
    alias s=start /pgm
    
     
  3. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    680
    Likes Received:
    8
    In my 4START.BTM, I have;

    Code:
    set .*=start /pgm
    Someone posted this method many years ago, which seems to work well for me.

    Joe
     
  4. forbin

    Joined:
    Dec 29, 2009
    Messages:
    25
    Likes Received:
    0
    I use this one frequently:
    Code:
    alias run=`(for %ff in (%$) echo %ff) & (for %ff in (%$) do %@QUOTE[%ff])`
    
    It's useful because I can type "run *something*" and run the one file, or even many files. The alias is broken up into two for-loops for a reason: if it starts spewing more than I expected, I can generally break out of it before too much gets started.
     

Share This Page