I need a bash function that prefixes a date_time string with a string.
show_neb_2017_05_20_16_55
My current function I am hoping would have done this, except that it is requiring a numeric argument.
function show_neb() {
a='show_neb_'$(date +"%Y_%m_%d__%H_%M")
return $a
}
echo $(show_neb)
I would have expected it to work, but it isn't. Isn't this just a direct standard output to a string?
returnonly returns success/failure, not a string. to do what you were attempting, tryecho "$a"; return 0;