-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathscript02.sh
More file actions
executable file
·37 lines (37 loc) · 835 Bytes
/
Copy pathscript02.sh
File metadata and controls
executable file
·37 lines (37 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/bash
# MM2090 : Introduction to Scientific Computing
# Dept of MME, IIT Madras, Chennai 600036 INDIA
# G. Phanikumar gphani@iitm.ac.in
#
# This script shows usage of expansions to create lists
# Things to pay attention to:
# * Use of {} for expansion
# * for loop
# * Variables i and n : the way they are set and are used
#
echo "Use of character range expansion"
for i in Char_{A..F}
do
n=$i.txt
echo $n
done
#
echo "------------------------------"
echo "Use of integer range expansion"
for i in Int_{1..10}
do
n=$i.txt
echo $n
done
#
echo "------------------------------"
echo "Use of a mix of character and integer range expansion"
for i in Mix_{A..F}{1..5}
do
n=$i.txt
echo $n
done
#
# Homework
# * Create a set of folders for months in a range of years
# * Create a set of files for all students of your class