小编Ezr*_*zra的帖子

SCP 匹配特定模式和扩展名的文件

我正在尝试将文件从远程主机 SCP 到本地主机。

远程主机上的文件为 KMST_DataFile_[MMDDYY]T[HHMM].kms

我想出了 2 个 SCP 命令,但我想知道是否有办法将这些命令组合起来,以仅匹配上面的文件名模式和扩展名 .kms 的 SCP 文件

scp -v user@remotehost:/location/KMST_DataFile_*

scp -v user@remotehost:/location/{*.kms}

unix linux scp

9
推荐指数
2
解决办法
2万
查看次数

TypeScript错误-类型'{}'不是数组类型或字符串类型

我有以下代码:

forkJoin([
    this.restangular.all(this.commonService.getHospitalURI()).getList(),
    this.restangular.all(this.commonService.getAgeGroupURI()).getList()
    ]).subscribe(responses => {

    const hospital_result = responses[0];
    // Error because of the line below
    const agegroup_result = Array.from(responses[1]);

    console.log('hospital ' + JSON.stringify(hospital_result))
    console.log('agegroup ' + JSON.stringify(agegroup_result))

    for (const productID_hospital of hospital_result[0]['product']) {

        for (const productID_agegroup of agegroup_result) {
          // Do Something here
        }
    }
  })
Run Code Online (Sandbox Code Playgroud)

我正在使用Angular 5,执行forkjoin来依次调用响应。这部分完全没问题。但是在尝试解析JSON时出现错误。

我收到此错误:

src/app/layout/insurance-list/insurance-list.component.ts(75,48): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Iterable<{}>'.
Property '[Symbol.iterator]' is missing in type '{}'.
Run Code Online (Sandbox Code Playgroud)

如果我改变

const agegroup_result = Array.from(responses[1]);
Run Code Online (Sandbox Code Playgroud)

至 …

typescript angular

2
推荐指数
1
解决办法
5749
查看次数

标签 统计

angular ×1

linux ×1

scp ×1

typescript ×1

unix ×1