View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000088 | tcsh | General | public | 2019-06-27 01:14 | 2019-12-05 01:17 |
Reporter | sharifib | Assigned To | christos | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 6.21.00 | ||||
Fixed in Version | 6.22.03 | ||||
Summary | 0000088: :q does not preserve empty strings | ||||
Description | The :q modifier appears to skip empty strings. This makes it very difficult to pass verbatim arguments to another program. | ||||
Steps To Reproduce | Minimal example: > echo $tcsh 6.21.00 > set arr= ( '1st arg' '' '3rd arg' ) > echo ${#arr} 3 > tcsh -c 'echo ${#argv}' $arr:q 2 > tcsh -c 'echo ${#argv}' '1st arg' '' '3rd arg' 3 Expected result: 3 3 3 | ||||
Additional Information | This is not new behavior, but complicates writing scripts that want to maintain and pass a variable number of arguments to other programs, some of which could possibly be empty. For example, something like the env command which may consume some initial arguments but does an exec with the remaining verbatim arguments. In tcsh, attempting to do the same with exec $argv[2-]:q apparently doesn't preserve any of the empty arguments. | ||||
Tags | No tags attached. | ||||
|
Another example: > set arr= ( '1st arg' '' '3rd arg' ) > set arr2= ( $arr:q ) > echo ${#arr} 3 > echo ${#arr2} 2 Expected result: 3 3 |
|
Fixed, thanks! |
|
I had to revert the change because it causes NUL characters inside expanded strings... |
|
Committed a new Q modifier so $args:gQ should DTRT. |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-06-27 01:14 | sharifib | New Issue | |
2019-06-27 01:18 | sharifib | Note Added: 0003256 | |
2019-08-01 16:05 | christos | Assigned To | => christos |
2019-08-01 16:05 | christos | Status | new => assigned |
2019-08-01 16:05 | christos | Status | assigned => resolved |
2019-08-01 16:05 | christos | Resolution | open => fixed |
2019-08-01 16:05 | christos | Fixed in Version | => 6.22.00 |
2019-08-01 16:05 | christos | Note Added: 0003276 | |
2019-11-30 14:52 | christos | Status | resolved => confirmed |
2019-11-30 14:52 | christos | Note Added: 0003337 | |
2019-12-05 01:17 | christos | Status | confirmed => resolved |
2019-12-05 01:17 | christos | Fixed in Version | 6.22.00 => 6.22.03 |
2019-12-05 01:17 | christos | Note Added: 0003338 |