On 12/04/2012 03:39 PM, Caspar Zhang wrote:
> On 12/04/2012 03:21 PM, Peng Haitao wrote:
>> + 84» .·cmdlib.sh
> 
> Patch series looks good to me except this.
> 
> sourcing a lib inside a function seems not so good. Yet I don't see any code 
> style rules telling which is the correct place to put a shell lib source 
> (commonly I think it would be the top in the file)
> 
        
Yeah. I think so, too. 
If sourcing a lib in the top of the file, the case will fail.
Because the case will use su xxx -lc to execute itself in xxx's home directory.
But cmdlib.sh is in /opt/ltp/testcases/bin/, not in xxx's home directory.


This has another method, add the following content in top of the file:

if [ "$(id -ru)" = 0 ]; then
        . cmdlib.sh
fi

I think add inside a function is simple:)
If you think add in top of the file will better, I will resend it.
Thanks.

-- 
Best Regards,
Peng

> Thanks,
> Caspar
> 
>> + 85» restart_daemon·atd
> 
> 
> 
> 

-- 
Best Regards,
Peng

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to