make 150 directories


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users make 150 directories
# 1  
Old 07-21-2006
make 150 directories

Hi,
I look for a script to create 150 directories :
d000
d001
d002
...
...
d149
would you help me please ?
I think it would be
for i
mkdir d$i

Many thanks.
PS :
#uname -a
AIX fserver 3 5 0050691A4C00
# 2  
Old 07-21-2006
edit: whoops.
# 3  
Old 07-23-2006
If your system has ksh installed...

Code:
#! /bin/ksh

typeset -Z3 counter=0
typeset -i i=0

while [[ ${i} -lt 150 ]]; do
   counter=${i}
   mkdir ./d${counter}
   (( i += 1 ))
done

exit 0

Cheers
ZB
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Programming

Makefile instructions to create directories (CentOS7 , GNU Make 3.82)

Hello, My makefiles are set up to generate an environment specific build directory based on the local configuration and some values passed to make. It generally looks like, # compilers, may be passed to make CC++ = g++ FCOMP = gfortran # version of program, may be passed to make ver =... (4 Replies)
Discussion started by: LMHmedchem
4 Replies

2. Shell Programming and Scripting

How to make faster loop in multiple directories?

Hello, I am under Ubuntu 18.04 Bionic. I have one shell script run.sh (which is out of my topic) to run files under multiple directories and one file to control all processes running under those directories (control.sh). I set a cronjob task to check each of them with two minutes of intervals.... (3 Replies)
Discussion started by: baris35
3 Replies

3. Shell Programming and Scripting

Copy directories in make file

LD:=C:/WindRiver/diab/5.9.3.0/WIN32/bin/dld.exe CFILES:=$(wildcard *.c) OBJFILES:=$(subst .c,.o, $(CFILES)) OBJ_PATH:=$(PRJ_PATH)/out/ ADDOBJFILES := $(addprefix $(OBJ_PATH),$(OBJFILES)) FILES:=C:/EB/tresos/workspace/Test_Spi/output/src copyfiles: cp ... (3 Replies)
Discussion started by: ushacy
3 Replies

4. Shell Programming and Scripting

Make directories containing subdirs using mkdir

Hello everybody, I wonder if there's a way to make a directory that contains multiple subdirectories. For example, if I want to make /home/student under the current working directory, how do I do it? Can I do it using a single mkdir command or do I have make home first, cd into it and then make... (1 Reply)
Discussion started by: Yongfeng
1 Replies

5. AIX

Type 7043-150 does not boot

Hello, I have an older RS/6000 system and it is not booting. It just keeps rebooting. If I try to put in the 5.3 install media it just sits at Starting Software...Please wait I searched other posts that say to go into maintenance mode from SMS menu and check if the filesystems are full... (8 Replies)
Discussion started by: n0s0up4u
8 Replies

6. Shell Programming and Scripting

Find all .htaccess files and make a backup copy in respective directories

Hey guys, I need to know how to locate all .htaccess files on the server and make a backup of them in the folder they reside before I run a script to modify all of them. So basically taking dir1/.htaccess and copying it as dir1/.htaccess_bk dir2/.htaccess copying as dir2/.htaccess_bk... (5 Replies)
Discussion started by: boxx
5 Replies

7. Shell Programming and Scripting

length between 100 and 150

how to locate lines longer than 100 and smaller than 150 characters using sed and grep??? (7 Replies)
Discussion started by: n_red_devils
7 Replies
Login or Register to Ask a Question