某些Unix共享库在从命令行调用时会提供输出,就像它们是可执行文件一样。例如:
$ /lib/libc.so.6
GNU C Library stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS
我有一段脚本:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my @arr = (
{
name => 'foo',
value => 123,
},
{
name => 'bar',
value => 'nan',
},
{
name => 'foobar',
value =>
我在我的linux机器上开发脚本已经有一段时间了,我也想在我的Mac上运行它。
我以为Mac上的功能和linux上的功能是一样的,但今天我意识到这是错误的。我知道Mac上的函数较少,但我认为那些确实存在的函数具有相同的实现。
此问题特别与date命令有关。
当我在我的linux机器上使用参数运行命令以提供以纳秒为单位的一些时间时,我得到了正确的结果,但是当我在我的mac上运行它时,它没有这个选项。
Linux-Machine> date +%N
55555555555 #Current time in nanoseconds
Mac-Machine> date +%N
N
如何在M