Something like this (Windows) example should work:
//! invoke cmd with current buffer name and line either in Build toolwindow or external shell
_command void cmdbl( boolean useShell = false ) name_info(','VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL)
{
_str cmdline=get_env("COMSPEC") " /k echo " maybe_quote_filename( p_buf_name ) " [line " p_RLine "]";
useShell ? shell( cmdline, 'NAP' ) : concur_command( cmdline, false, true, false, false );
}
As commented use on SE cmdline: 'cmdbl' to run in Build toolwindow or 'cmdbl 1' to launch cmd in external shell.
Have fun, HS2