weixin_39527911
weixin_39527911
2020-11-25 16:21

rumprun launcher: trim od output to support OS X

od output format has trailing whitespace and is separated by two spaces in OS X. So a bit of manipulation is required.
Command invocation tested in OS X and Linux. Tested in OS X rumprun launcher.

该提问来源于开源项目:rumpkernel/rumprun

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39924307 weixin_39924307 5月前

    oh, and you forgot to add yourself to AUTHORS

    点赞 评论 复制链接分享
  • weixin_39527911 weixin_39527911 5月前

    I thought that seeing as it's now using printf the whole of the MAC address should be in there

    点赞 评论 复制链接分享
  • weixin_39924307 weixin_39924307 5月前

    Even easier in that situation: od | xargs printf "....\n"

    Can you squash the non-AUTHORS commits?

    点赞 评论 复制链接分享
  • weixin_39924307 weixin_39924307 5月前

    thanks!

    点赞 评论 复制链接分享
  • weixin_39924307 weixin_39924307 5月前

    awk 'NR==1{...}' is the same as piping through head. IMO the latter is more elegant and readable.

    点赞 评论 复制链接分享
  • weixin_39924307 weixin_39924307 5月前

    though, if you're going to use awk, why not just printf("%s:%s"%s\n", $1, $2, $3) ?

    点赞 评论 复制链接分享

相关推荐