Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Write Scripts Using Statements and Functions - Lab 11 | CSCI 2200, Lab Reports of Computer Science

Material Type: Lab; Professor: Zucker; Class: Unix Fundamentals; Subject: Computer & Information Science (CSCI); University: East Tennessee State University; Term: Unknown 1989;

Typology: Lab Reports

Pre 2010

Uploaded on 08/18/2009

koofers-user-74k
koofers-user-74k 🇺🇸

10 documents

1 / 5

Toggle sidebar

Related documents


Partial preview of the text

Download Write Scripts Using Statements and Functions - Lab 11 | CSCI 2200 and more Lab Reports Computer Science in PDF only on Docsity! CSCI 2200 Name: _____________________ Lab 11: In this lab we will begin to write scripts using repetition statements and functions. Objectives: • Reinforce Unix scripting • Introduce Repetition/looping – counting loops – conditional loops • Introduce functions Go to the scripts directory created in labs 8 - 10. We will be using this directory for the lab. 1. (2 points) Use the for file in `ls *` loop (use the `ls *`, even though simply * will do) to create a script called dirlist that will list the names of all of the files in the current directory. Show the contents of the script. 2. (1 point) Create a new directory in the scripts directory called testdir. What is the command to do this? 3. (1 point) Run the dirlist script again. What does it show for testdir? 4. (1 point) Modify dirlist (but do not modify the for statement) to display only the directory name or filenames (without extra characters) What lines were added/modified in dirlist? 5. Modify dirlist so that it only displays the names of the directories in the format: name is a directory. (where name is a directory name in this directory) a. (3 points) What does the script look like? b. (1 point) What is the output from running this script
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved