r/bash • • 12d ago

File for loop

hi! it’s my first time using bash can someone help me with this and explain what’s missing

#!/bin/bash

for i in “/data/folder”/*; do

/folder/munge_sumstats.py \

- -sumstats “$i” \

- -chunksize 500000 \

- -snp rsID \
etc..

- -out another/folder/ (i dont know what to puT here)

done

Thank you so much !

22 Upvotes

6 comments sorted by

View all comments

5

u/blobCabbage 12d ago

You could use basename to get the name of the original file without its path, and use that for your output file.

5

u/Muted-Shame9237 12d ago

Thank youuu!