Mayx's Home Page https://mabbs.github.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
624 B

  1. ---
  2. layout: post
  3. title: Mayx应聘失败
  4. tags: [应聘, Shell, 运维, 面向时间]
  5. ---
  6. 今天,Mayx去某公司面试运维,然后考官出了一道题:
  7. 如何用Linux shell排序?<!--more-->
  8. Mayx想了想,写出了以下代码:
  9. ```shell
  10. #!/bin/sh
  11. num="4 5 1 9 3 6 7 4 1 12"
  12. for j in $num
  13. do
  14. {
  15. sleep $j
  16. printf "$j "
  17. }&
  18. done
  19. wait
  20. ```
  21. 执行效果:`1 1 3 4 4 5 6 7 9 12`
  22. 然后,Mayx被赶出来了……
  23. 我写的代码明明可以执行,效果也没问题,居然赶我出来,这一定是个垃圾公司!
  24. 后来才知道,他们想让我回答`sort`,果然是垃圾公司(笑)

Powered by TurnKey Linux.