Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task2.5: Write a script that will ask the user for to input a file name and then create the file and echo to the screen

image text in transcribed
Task2.5: Write a script that will ask the user for to input a file name and then create the file and echo to the screen that the file name inputted had been created 1. Open a new file script creafile.sh using vi editor #vi creafilesh 2. Type the following lines Department of Computer Science Spring 2029 #1/bin/bash echo 'enter a file name:" read FILENAME touch $FILENAME echo "SFILENAME has been created" 3. Add the execute permission 4. Run the script 8./creafile.sh S. Enter the file name you want to create 6. Check whether file is created Task 2.6: In this exercise, you will create a script to echo users, based on a list of usernames in a file. 1. create a new file called userlist. #viuserlist 2. Insert a short list of usernames, such as the following. Make sure that none are the names of existing users moe larry curly binny 3. create a script file userscript.sh and type the following lines #1/bin/bash for TheUSER in $(cat userlist) do echo The user is STheUSER done 4. Add the permissions and run the script

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

New Trends In Databases And Information Systems Adbis 2019 Short Papers Workshops Bbigap Qauca Sembdm Simpda M2p Madeisd And Doctoral Consortium Bled Slovenia September 8 11 2019 Proceedings

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Robert Wrembel ,Mirjana Ivanovic ,Johann Gamper ,Mikolaj Morzy ,Theodoros Tzouramanis ,Jerome Darmont

1st Edition

3030302776, 978-3030302771

More Books

Students also viewed these Databases questions