Question: Hello I have bash scripting homework could you help me emergency Bash Scripting 1) Write a shell script called createFolder.sh that creates a directory under
Bash Scripting 1) Write a shell script called createFolder.sh that creates a directory under the current directory for each string given as arguments to the script. In your solution, you MUST use the tr command and xargs Folder name should not contain whitespaces. If the given string contains spaces, delete all s characters. E.g. If the argument string is "My Directory', the directory name should be MyDirectory Folder name should capitalize all letters. pace For example when you run your script as /createFolder.sh 'aaa' 'bbb' 'ccc ddd' it should create the directories AAA, BBB and 2) Write a shell script mystery.sh which takes a directory name as argument and will output the name and size of the largest (in bytes) regular file under that directory. You should do the appropriate error checking: For example, print an error message if no argument is provided, or ifa given argument is not a directory You will call your script as ./mystery.sh TestDir 3) Write a bash script, reverse.sh which takes a directory name as argument. It first places the contents of the directory in an array. Then it reverses the array using a function reverse). Finally it will output the reversed array one entry per line and each line preceded by a line number You may assume that the given directory exists under your current working directory. For example if the the directory called TestDir contains "games lib movies research teaching," your program when run as ./reverse.sh TestDirwill output 1. teaching 2. research 3. movies 4. lib 5. games You MUST use an array and a function reverse) in your solution. DO NOT use the built-in command sort -r Bash Scripting 1) Write a shell script called createFolder.sh that creates a directory under the current directory for each string given as arguments to the script. In your solution, you MUST use the tr command and xargs Folder name should not contain whitespaces. If the given string contains spaces, delete all s characters. E.g. If the argument string is "My Directory', the directory name should be MyDirectory Folder name should capitalize all letters. pace For example when you run your script as /createFolder.sh 'aaa' 'bbb' 'ccc ddd' it should create the directories AAA, BBB and 2) Write a shell script mystery.sh which takes a directory name as argument and will output the name and size of the largest (in bytes) regular file under that directory. You should do the appropriate error checking: For example, print an error message if no argument is provided, or ifa given argument is not a directory You will call your script as ./mystery.sh TestDir 3) Write a bash script, reverse.sh which takes a directory name as argument. It first places the contents of the directory in an array. Then it reverses the array using a function reverse). Finally it will output the reversed array one entry per line and each line preceded by a line number You may assume that the given directory exists under your current working directory. For example if the the directory called TestDir contains "games lib movies research teaching," your program when run as ./reverse.sh TestDirwill output 1. teaching 2. research 3. movies 4. lib 5. games You MUST use an array and a function reverse) in your solution. DO NOT use the built-in command sort -r
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
