unix - How to use cut command to shorten a file name, and use it inside a bash script? -


i use text of variable, fileroot, input command. however, fileroot based upon name of file in same directory.

so far, have

for file in *on.nii;      fileroot="cut -c 1-78 ${file}" done 

i getting unrecognised option -c command. ideas on how limit {file} 78 characters?

simply address string, instead of using cut:

for file in *on.nii;      fileroot="${file:0:78}" done 

Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -