I just noticed, both echo and return works fine for displaying content from a shortcode function in wordpress.
echo
return
function foobar_short
If you are outputting a lot of contents, then you should use:
add_shortcode('test', 'test_func'); function test_func( $args ) { ob_start(); ?>