You can use seq's formatting option and avoid the loop by passing multiple args to touch:
touch `seq -f %.0f.txt 1 999`
1
votes
I've just created a simple script that does it:
file name: script
\#!/bin/tcsh
set j = 1
while ($j <= 10000)
touch $j.txt
@ j++
end
changed the permissions for the script to +x :
chmod +x script
and executed :
./script
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more