You should really use sprintf() instead of strcpy and strcat, it will look something like this: sprintf(pro, "%s%s%s%s%c%s%s%s%c%s%s%s%s", "qsub -P ", argv[2], " -wd -e ", cwd, '/', str, ".error -b y /usr/local/projects/bin/program -i ", cwd, '/', str, " -type p -terms -lookup -o ", str, ".qsub"); after this call pro[] buffer contains formatted string :-) And few remarks about your code safety: be careful with creating huge local buffers on the stuck - pro[] buffer in this case. It may happen that you get stuck overflow (application crush) It is better to create such buffers dynamically then you can check if allocation succeeded or just create static buffer use sizeof(str) in fgets(str, sizeof(str), f) to avoid problems with writing outsie str[] memory area when str[] buffer size will be changed to smaller one
G
grzkas
@grzkas