Question

1) Copy bother10.sh from /home/ghoffman/course_files/it244_files to your hw6 directory. Run this program in the background redirecting...

1) Copy bother10.sh from /home/ghoffman/course_files/it244_files to your hw6 directory.
Run this program in the background redirecting output to /dev/null.
Be sure you copy and run bother10.sh, NOT bother.sh.

2) Run a command that shows the job number of the process running bother10.sh.

3) Run a command that shows the process ID of the process running bother10.sh.

4) Copy the script make_foo.sh from ~ghoffman/course_files/it244_files to your current directory.
Run this script.
Using touch, create the file foo.txt.
Perform a long listing of all files whose name starts with the string "foo" using meta-characters.

5) Using meta-characters, perform a long listing of all files whose name starts with the string "foo", followed by a single character, followed by .txt .

6) Using meta-characters, perform a long listing of all files whose name starts with the string "foo", followed by a single digit, either 1, 3 or 5, followed by .txt .

7) Using meta-characters, perform a long listing of all files whose name starts with the string "foo", followed by a single digit from 1 through 5 followed by .txt . Do this using the range feature of one of the meta-characters.

8) Using meta-characters, perform a long listing of all files whose name starts with the string "foo" followed by a single digit, not 1, nor 3 nor 5, followed by .txt .

9) Using meta-characters, perform a long listing of all files whose name starts with the string "foo" followed by two digits followed by .txt .

10) Using meta-characters, perform a long listing of the files foo21.txt, foo25.txt and foo29.txt. This must be done using a single command.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi,Let me know if you need more information/implementation:-

======================================================

Take this code to hw6.sh/<ur choice>

=========================================

ss139t@chinnasrinu-VirtualBox:~$ cat hw6.sh
#/bin/bash

echo "START"
echo "STEP1"
cp /home/ghoffman/course_files/it244_files/bother10.sh hw6/ >> /dev/null &

echo "STEP2"
echo $!

echo "STEP3"
jobs -l | awk -F" " '$0 =~ /bother10.sh/ { print $2; }'

echo "STEP4"
cp ~ghoffman/course_files/it244_files/make_foo.sh .

echo "STEP5"
chmod 755 make_foo.sh
./make_foo.sh

echo "STEP6"
touch foo.txt

echo "STEP7"
ls -lt foo*

echo "STEP8"
ls -lt foo[a-z].txt

echo "STEP9"
ls -lt foo[135].txt

echo "STEP10"
ls -lt foo[1-5].txt

echo "STEP11"
ls -lt foo[0246-9].txt

echo "STEP12"
ls -lt foo[0-9]?.txt

echo "STEP13"
ls -lt foo21.txt foo25.txt foo29.txt

echo "DONE"


============================================

STEP8 -rwxr-xr-x 1 ss139t ss139t 0 Jul 11 12:07 fooA.txt -rwxr-xr-x 1 ss139t ss139t 0 Jul 11 12:05 foob.txt -rwxr-xr-x 1 ss13

=============================================

Please Comment if required.

============================================

Thanks

Add a comment
Know the answer?
Add Answer to:
1) Copy bother10.sh from /home/ghoffman/course_files/it244_files to your hw6 directory. Run this program in the background redirecting...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Navigate to your home directory by typing cd. Now type ls and notice that there...

    1. Navigate to your home directory by typing cd. Now type ls and notice that there is a subdirectory called Downloads. Now navigate to the root of the file system by typing cd /. From here, which single command would you use to navigate directly to the Downloads folder that is located in your home directory? The output of the command would be as follows: 2. From the Downloads directory which single command would you use to navigate back up...

  • Question 1) Copy file called sortfile from my home directory. The file contains three columns of...

    Question 1) Copy file called sortfile from my home directory. The file contains three columns of information : username, uid number and group name respectively, separated by a field separator. Will the following command sort the file on the group name field? sort -t! -k3 sortfile A) Yes B) No Question 2) Copy the file called sortfile from my home directory. The file contains three columns of information : username, uid number and group name respectively, separated by a field...

  • LUNIX (Please Label) Exit vi (:q) and from the command line, type viscript4.sh. For this script,...

    LUNIX (Please Label) Exit vi (:q) and from the command line, type viscript4.sh. For this script, we will iterate through all files in the current directory print out their name using the for loop. Example (do not type yet): foriin*;do …;done where the…does some operation on$I, which stands for the current file. To do this, enter the following in your script4.sh file:           #!/bin/bash           for i in *; do                echo $i           done Once the above works, change the for loop to...

  • (In Linux) 1. Create a file to write to from your script and save it as...

    (In Linux) 1. Create a file to write to from your script and save it as “.txt”. 2. Write the following information to the file that you created in Step 1: Today's date Your full name Your student ID The name of your course What directory you are in File permissions of the file that you created that allow everyone to read, write, and execute The long list of files in your current directory, providing all items and their process...

  • Copy/Paste your script from 5b here. 4. Let's look at a more complicated script executable. a....

    Copy/Paste your script from 5b here. 4. Let's look at a more complicated script executable. a. Write the following as script6.sh and change its permissions to count for num in d do if num eq 100 then count (count+1) done echo The number 10 was found $count times What is the output? Run the script as ./script6.sh 10 20 30 10 40 20 50 10 60 <enter Summarize what the script does r using the read command. The following script...

  • Objective : Write a C Shell script which copies all files(*.java and *.class) from your home dire...

    Objective : Write a C Shell script which copies all files(*.java and *.class) from your home directory to a new one, and Analyze the new directory information such as number of files, user permissions, and disk usage. Sample Output:                                                    << CS Directory Analysis >>      Date:   ============================================================ Current Directory: /home/tomss New Directory Created : /home/tomss/pgm01 File information Total Number of files : 22 files Directory files:   0 files Plain text files:   10 files File have read permissions: 3 files File have...

  • 1. Set up an easy way to copy files from /home/distribution/cnguyen/cis18b directory on voyager, without having...

    1. Set up an easy way to copy files from /home/distribution/cnguyen/cis18b directory on voyager, without having to type the long path name every time. Make your set up “permanent” for this quarter (the set up should last from one login session to another). 2. Use echo to write a brief explanation of your set up in step 1. 3. If you are not at your home directory, go to your home directory and don’t change directory for the rest of...

  • Problem 1 Write a BASH script to create a user account from the Linux system on...

    Problem 1 Write a BASH script to create a user account from the Linux system on which your script is run. The script should process two positional parameters. First positional parameter is supposed to be a string with a user name (e.g., user_name) Second positional parameter is supposed to be a string with a user password (e.g., user_password) In your script: Check if two positional parameters were passed to your script when it was invoked If NOT, print an appropriate...

  • Need to solve this program which will run exactly like sample run .. Thanks Project 2...

    Need to solve this program which will run exactly like sample run .. Thanks Project 2 Using Classes and Objects (Chapter 3) Duc: sec calendar Two files to be submitted: . Algorithm of method main (AlgorithmOfMain.txt, no credit if this is missing) Java Source code (CarpetBill.java- no credit if this has syntax errors) Write a program that creates customers' bills for a carpet company when the information below is given: irst name .Length and width of the carpet in feet...

  • Write a c++ program in that file to perform a “Search and Replace All” operation. This...

    Write a c++ program in that file to perform a “Search and Replace All” operation. This operation consists of performing a case-sensitive search for all occurrences of an arbitrary sequence of characters within a file and substituting another arbitrary sequence in place of them. Please note: One of the biggest problems some students have with this exercise occurs simply because they don’t read the command line information in the course document titled “Using the Compiler’s IDE”. Your program: 1. must...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT