In the off chance that someone finds themselves beating their head against the wall trying to figure out why a coworker's script won't print newlines, look out for this ->

#!/bin/bash

function GET_RECORDS()

{

echo -e "starting\n the process";

}

echo $(GET_RECORDS);

As in the above, the actual running of the method may itself be wrapped in an echo which supersedes any echos that may be in the method itself. Obviously I watered this down for brevity, it was not so easy to spot!

You can then inform your comrades that a better way to execute functions would be like so:

#!/bin/bash

function GET_RECORDS()

{

echo -e "starting\n the process";

}

GET_RECORDS;

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐