简体   繁体   English

什么是AIX下的AIX上的'what'命令

[英]what is the 'what' command on AIX under LINUX

I am used to use what to find out some version string in my program, which is normal defined as a string in the c++ code, starting with "@(#)". 我习惯使用什么来查找程序中的某些版本字符串,这通常被定义为c ++代码中的字符串,以“@(#)”开头。

Now I cannot find it in Linux. 现在我在Linux中找不到它。 Can anyone tell me what I am supposed to do? 谁能告诉我我应该做什么? Thanks a lot! 非常感谢!

The what command is part of the Source Code Control System (SCCS), which is not commonly available on Linux (if there is a Linux version at all). what命令是源代码控制系统(SCCS)的一部分,在Linux上通常不可用(如果有Linux版本)。 You can try to emulate it with the strings command: 您可以尝试使用strings命令模拟它:

strings a.out | fgrep '@(#)'

Reimplementations of what are available in CSSC (an SCCS-to-modern version control conversion package) and in BSD ( source code ). 重新实现CSSC (SCCS到现代版本控制转换包)和BSD( 源代码 )中可用的what

试试这个

strings myprogram | grep '@('

As @larsmans said, what command is part of SCCS . 正如@larsmans所说, what命令是SCCS的一部分。 Here is the link to the GNU replacement for SCCS 以下是 SCCS的GNU替换的链接

The following command gives most equivalent output compared to what 以下命令提供了与等效输出相比最大的输出
strings filename | strings filename | grep -o \\"\\"@(#).*\\"\\" | grep -o \\“\\”@(#)。* \\“\\”| sed 's/^\\"@(#)//' | sed 's/\\"$//' sed's / ^ \\“@(#)//'| sed's / \\”$ //'

除了提到SCCS之外, ident也是RCS的等价物(并且有很多工具使用与RCS相同的标记,CVS是其中的第一个)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM