2
votes

I would like to create multiple empty files using tcsh, similar to the command:

touch {0..999}.txt

no bash installed.

%echo $SHELL

%/bin/tcsh

If possible, not using script but a terminal command

2

2 Answers

2
votes

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