GNU排序如何处理相同的密钥?

时间:2017-05-27 08:37:20

标签: sorting

众所周知,this.changePasswordForm = fb.group({ 'oldpass': ['', Validators.compose([Validators.required, Validators.minLength(6)])], 'newpass': ['', Validators.compose([Validators.required, Validators.minLength(6), (control) => this.confirmPasswordValidator(control, this.changePasswordForm ? this.changePasswordForm.controls['oldpass'].value : '', false)])], 'confirmpass': ['', Validators.compose([Validators.required, (control) => this.confirmPasswordValidator(control, this.changePasswordForm ? this.changePasswordForm.controls['newpass'].value : '') ])], 'otp': [''] }); 会根据第二列对文件进行排序。但是如果文件包含第二列中具有相同值的多行,那么GNU sort将如何处理它们?

2 个答案:

答案 0 :(得分:0)

您需要-s选项:

  

--stable (-s)选项禁用此最后的比较,以便所有字段比较相等的行保留其原始相对顺序

答案 1 :(得分:0)

-s参数用于稳定排序(将保留先前的相对排序)。

如果未提供-s(稳定排序)参数,则会有最后的比较(全行)来确定排序。

相关问题