| Quote: | | | Originally Posted by goru | | | | |
| hi, nt quite sure why i am posting it in BF and whether nyone will reply or nt. I need to create multiple output file like output_1.txt output_2.txt ...output_100.txt in a DO loop. any one have any idea, i think in banglaforum there are quite a few good programming expert exits. | |
| | |
Write a shell script that you can make executable.
-----------------------------------------------------------------------
#!/bin/sh
set -x
varx=1
HOME_DIR=/home/user/workingdirectory
cd ${HOME_DIR}
while [ $varx -le 100 ]; do
touch output_${varx}.txt
varx=`expr $varx + 1 `
done
--------------------------------------------------------------------------
Put the path of the current directory in the place of /home/user/workingdirectory
Copy what is written within the lines above in a text file. Name the text file anything, say, createfile
Use the command
chmod 775 createfile
in a shell terminal. Then execute by writting
./createfile
You can also do the same in a terminal command line directly.
Of course, all these are for Linux/Unix environment.