Using a loop with xargs in one line -


i using tcsh. want output:

mkdir dir1 dir2 dir3 dir4 

where of course maximum number of dirs variable. point contain incrementing variable loop in names. have feeling should use xargs. want able use simple loop, , in 1 line if possible. possible? feeling like:

loop here | xargs mkdir 

but not able make syntax work.

edit: figured out how multiple lines of input. know how make following single line input?

for in {1..5} echo -n " dir$i" done \ | xargs mkdir 

code:

foreach ( `seq 1 1 10` )   mkdir dir$a end 

or

seq -f 'dir%.0f' -s ' ' 1 1 10 | xargs mkdir 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -