
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
UNIX and Shell
please include script and
Consider the following script:
#!/bin/bash
list=$1
for i in $list
do
echo $i
done
In this form it works thusly:
$ ./ttt.sh 1,2,3,4,5
1,2,3,4,5
Modify the “list=$1” line so that it works like the below (Hint: process substitution, stream editing).
Just change the line, do not add any other line/s; and do not use the IFS specification:
$ ./ttt.sh 1,2,3,4,5
1
2
3
4
5
Now, modify the script so that it now works like:
$ ./ttt.sh 1,2,3,4,5
1 2 3 4 5
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Need helparrow_forwardIn Python, _____________ writes the strings in the list data to the file. a. writelist(data) b. writedata(list) c. writelines(data) d. write(lines=True) Which one is correct?arrow_forwardpython: In the Python terminal, the command dir(list) returns a list of operations that can be performed on lists. choose three (3) operations from this list and, in your own words, describe what it does, how to use it, and give your own example. Try to choose operations that have not been completed yet.arrow_forward
- PYTHON!!! Write a function that will filter course grades that are stored in a list, creating and returning a new list. Your implementation must have the following rules: - The function must accept two (and only two) parameters: The first is: the maximum integer value for any grade to remain in the list (any value above the maximum will be filtered and removed from the list). The second is: the list of grades (you can assume the list contains only integer values) - The function must return a new list and not modify the existing list. - The function must use a list comprehension to filter the existing list and create the new list that is returned. - DO NOT USE THE: built-in-"filter" function.arrow_forwardWrite a program called p1.py that contains a function called filereader() that takes a number n (int) and a filename (string) as input. The function should read and store every nth line of the file in a list and return it.Test your function inside the main function (don’t forget the main guard).Sample output with “samplefile_t8.txt” file. It contains the following lines of text.kangaroo, 5capybara, 7wombat, 2koala, 3wallaby, 4quokka, 5platypus, 9dingo, 2kookaburra, 1>>> filereader(“samplefile_t8.txt”, 3) returns[“wombat, 2”, “quokka, 5”, “kookaburra, 1”]arrow_forwardWrite a Python program that will read in an input file named RandomNumbers.txt and place all the positive values in a list. From there, display this list sorted in ascending order. Use at least 4 functions within the program. Remember, main() should become a to-do list calling the functions in the order in which they should execute. Each function should perform 1 task only. In addition to the above, be sure your code handles the following exception: any IOError exception that is thrown when the file is opened and data is read from it REQUIREMENTS: Use functions throughout. The function main should only call functions in the order needed. Keep the functions modular and performing only one task. Add a beginning and ending statement so the user will know when the program begins and ends. Comment throughout the code. The program should look for the file in the current directory. Example: If the input file contains the following data: 99-11044-22 The program output should be:…arrow_forward
- Which of the following situations will lead to an object being aliased? Select all that apply. O Assigning a string to S1, then using S1 in a function call with header "def foo(x: str) -> None" O Assigning a list to L1, then assigning the result of slicing L1 (i.e., L1[:]) to L2 OAssigning a list to L1, then assigning the result of a copy() method on L1 to L2 O Assigning a list to L1, then assigning L1 to L2 O Assigning a string to S1, then assigning the result of slicing S1 (i.e. S1[:]) to S2 OAssigning a string to S1, then assigning the result of a replace() method on S1 to S2 OAssigning a list to L1, then using L1 in a function call with header "def foo(x: List) -> List" O Assigning two lists to L1 and L2, then assigning the result of adding them to L3arrow_forwardWrite one line of code that reads a full line from a file with file handle fp into a string defined aschar line[256]. Do this using both fscanf and fgets.arrow_forwardCould you add functions (def) to the code. You can change the code but the output must be the same. Please write your OWN code and attach the picture. Thanks!arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education