Exercise: File content round 2


Use the following script to create a subdirectory called 'file_conent' and in it a file called 'data.txt'. Once we have the file, replace the numbers with their duplication so 1 will become 11.


examples/linux/file_content.sh
#!/bin/bash

DIR='file_content'
FILE=$DIR/data.txt

if [ -e $DIR ]
then
   echo "$DIR already exists"
   exit
fi

echo "Creating directory $DIR"
mkdir $DIR

cat<<TEXT > $FILE
Hello World
This is the second line
1 hundred 2 hunderd 3 hundred
TEXT