Want to check whether a command succeeded by redirecting its output to a variable
问题 I'm currently writing a bash script which loads video files up to to YouTube using GoogleCL. As I'm doing this uploading stuff in a loop (because there can be multiple video files) I would like to check if each file had been uploaded successfully before I upload the next one. The command google youtube post --access unlisted --category Tech $f (where $f represents the file) outputs a string which tells me whether the upload has been successful or not. But I don't know how to redirect that