Split function not working in UNIX -


i'm trying run split on file filename has spaces in it.

i can't seem work. have following

source_file="test file.txt" split -l 100 $source_file 

now i've tried enclosing $source_file in " no luck:

split -l 100 "\""$source_file"\"" 

or even

split -l 100 '"'$source_file'"' 

i'm still getting:

usage: split [-l line_count] [-a suffix_length] [file [name]]    or: split -b number[k|m] [-a suffix_length] [file [name]] 

you're trying hard! single set of double quotes suffice:

split -l 100 "$source_file" 

you want arguments split this:

-l 100 test file.txt 

the commands trying both yield these arguments:

-l 100 "test file.txt" 

as in, equivalent incorrect command:

split -l 100 '"test' 'file.txt"' 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -