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
Post a Comment