Can run shell script with su?

Is there a way to run shell script that need ‘su’ permission ?
something like adb shell “su -c ‘pm enable component’” (i don’t want to use run.exec)