This is a static copy of a profile reportHome
ls>quoteUnixCmdArg (20 calls, 0.030 sec)
Generated 05-Nov-2014 07:52:33 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/matlab/general/ls.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
ls | function | 20 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
89 | quotedArgs = strcat(' ''', quo... | 20 | 0.020 s | 66.7% |  |
90 | quotedArgs = [quotedArgs{:}]; | 20 | 0 s | 0% |  |
87 | quotedArgs= regexprep(quotedAr... | 20 | 0 s | 0% |  |
84 | quotedArgs= regexprep(tildeArg... | 20 | 0 s | 0% |  |
79 | if ~isempty(ix) | 20 | 0 s | 0% |  |
All other lines | | | 0.010 s | 33.3% |  |
Totals | | | 0.030 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
cell.strcat | function | 20 | 0.020 s | 66.7% |  |
Self time (built-ins, overhead, etc.) | | | 0.010 s | 33.3% |  |
Totals | | | 0.030 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 23 |
Non-code lines (comments, blank lines) | 14 |
Code lines (lines that can run) | 9 |
Code lines that did run | 7 |
Code lines that did not run | 2 |
Coverage (did run/can run) | 77.78 % |
Function listing
time calls line
68 function quotedArgs = quoteUnixCmdArg(varargin)
69 % Algorithm: Start and end each argument with a single quote (squote).
70 % Within each argument:
71 % 1. squote -> squote '\' squote squote
72 % 2. '!' -> squote '\' '!' squote
73 % 3. '*' -> squote '*' squote (MATLAB globbing character)
74 %
75
76 % Do any tilde expansion first
20 77 tildeArgs = varargin;
20 78 ix = find(strncmp(tildeArgs,'~',1));
20 79 if ~isempty(ix)
80 tildeArgs(ix) = unix_tilde_expansion(tildeArgs(ix));
81 end
82
83 % Special cases to maintain as literal: single quote or ! with '\thing_I_found'
20 84 quotedArgs= regexprep(tildeArgs,'[''!]','''\\$&''');
85
86 % Special cases to maintain as NOT literal: Replace * with 'thing_I_found'
20 87 quotedArgs= regexprep(quotedArgs,'[*]','''$&''');
88
0.02 20 89 quotedArgs = strcat(' ''', quotedArgs, '''');
20 90 quotedArgs = [quotedArgs{:}];