954,148 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Linux Bash Script

Can someone please help me with the following questions.

1) Create a script that will produce a text file that has a list of the files in the present working directory. Ensure you use the proper syntax to allow auto-execution from the command prompt.

Use internal documentation (comments) to place your name and the course name in the script.

2) Create a Bash script that will copy all the files in one directory to another directory. You may name the receiving directory anything you like. Ensure you use the proper syntax to allow auto-execution from the command prompt.

Use internal documentation (comments) to place your name and the course name in the script.

AlvinRey70
Newbie Poster
4 posts since Feb 2008
Reputation Points: 9
Solved Threads: 0
 

Hey there,

1.

#!/bin/bash
#
# your name
# your course

ls >FILE.txt


2.

#!/bin/bash
#
# your name
# your course

cp -r dir/* newdir/*


Don't forget to chmod them at least 700 so they can be executed from the command line.

Best wishes,

, ike

eggi
Posting Pro in Training
400 posts since Oct 2007
Reputation Points: 102
Solved Threads: 47
 

you didn't even try to conceal this is a homework assignment...

DimaYasny
Posting Virtuoso
Moderator
1,777 posts since Jan 2007
Reputation Points: 183
Solved Threads: 89
 

lol u just did his homework for him!!

chris5126
Posting Pro in Training
415 posts since Feb 2006
Reputation Points: 38
Solved Threads: 15
 

:) Yeah - Every once and a while, I like an easy one :)

Who loses? ;)

, Mike

eggi
Posting Pro in Training
400 posts since Oct 2007
Reputation Points: 102
Solved Threads: 47
 

:) Yeah - Every once and a while, I like an easy one :)

Who loses? ;)

, Mike

I gained something from it...learn something new everyday!:cool:

Templeofjava
Newbie Poster
1 post since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

Do your home work. Spend some time on the
linux bash shell scripting guide .

moqwen
Newbie Poster
1 post since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You