osx - How to deal with colons ":" in filename in shell script -


i have large group of files ":" in file names. when i'm in interactive shell, typing "\" , hitting tab trick them recognized valid inputs commands, not in shell script.

i've tried

less file:name.txt less file\:name.txt less 'file\:name.txt less 'file:name.txt' 

and it's not recognized valid file.

however on interactive command line type less, followed first file, type \, , hit tab key, works...

how do in shell script?

use double quotes:

less "file:name.txt" 

bash recognizes value within double quotes full string.

as seen in using quotes include spaces , characters in filenames:

if want work files spaces or special characters in filename, may have use quotes.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -