Unix shell commands


 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions Unix shell commands
# 1  
Old 03-24-2010
Data Unix shell commands

Hello, ive recently finished university and im working as an assistant teacher in a secondary school. ive been given the objective t o give the students an assignment with a simple shell program in C/C++ with the support for several commands the Shell must also have the ability of processing commands from a batch file alongside usual user interaction through the command prompt.
All commands required will be implemented through the associated
functions or API calls. Under no circumstances will the student be calling a precompiled existing command. I have made excercises for them for the LAB so they have developed the skills on how existing API cuntions can be used to accomplish such tasks.

I have told them that this is not allowed as they are only
calling a precompiled executable:
If user asked for files in directory then
execv ("/bin/ls", cmd);

but i've got this command that is alright to use as it is calling a written function that lists files in the directory:
If user asked for files in directory then
listFiesInDir();
/* Function that list files
in directory*/

Along with this i have also given the task of requiring them to us makefile facilities. and this is up to you on how it is organized. Either all functions can be put under one header, or have independent header files encapsulating individual functions used by the shell. And they are required to put in their
/* Student ID : 0000001*/
/* Name : Syed Alam*/
/* BSc Software Engineering*/

the problem im getting is that i get many syntax errors even from the beginning and im unable to accomplish the task myself. can anyone please help me with this. Thank You !
# 2  
Old 03-24-2010
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Display Pie Chart/Bar Graph in microsoft outlook email using UNIX commands/Shell scripts

I have a shell script which executes to write html codes into a text file. My next step is to email the text file so that receiving person (people who i send email to) should be able to see pie/chart or bar graph (whatever i design in my code) in their email. Following is the example of a sample... (7 Replies)
Discussion started by: bikerboy
7 Replies

2. Shell Programming and Scripting

Shell script with mutiple steps/commands, on UNIX servers

Hi, I wrote a simple script, which will call other scripts or run commands on a UNIX server. my script has multiple steps/commands with some delay in between. I usually get some email notifications after the successful execution of each step. **My intention is to get email alerts when it is... (5 Replies)
Discussion started by: System Admin 77
5 Replies

3. Shell Programming and Scripting

Any shell or hack that makes the shell command line take vi commands?

basically i'm tired of hitting the left arrow a few dozen times when correcting a mistake or modifying a history command i'd like to use vim style key shortcuts while on the command line so that a 55 moves the cursor 55 places to the left... and i want all the other vi goodies, search of... (3 Replies)
Discussion started by: marqul
3 Replies

4. Shell Programming and Scripting

Need help embedding Unix commands in a shell script

Hi Folks, I have a text file which may or may not have any data. I would like to email the file, via a Korn shell script, if the file is not empty. I am fiddling around with the wc -l command, but no luck so far. The pseudo code is as follows count=`wc -l test.txt` if cat test.txt... (4 Replies)
Discussion started by: rogers42
4 Replies

5. Shell Programming and Scripting

to create a phone book using shell script and unix commands

can you help me to create a phone book with add, delete, modify with first name, last name, middle name, phone no(multiple ph no), address, email address, notes or comments to store about the contact and groups that hold for the contact.. i am new to this linux environment. please guide me. ... (1 Reply)
Discussion started by: monster11209
1 Replies

6. Shell Programming and Scripting

Unix commands failing inside the shell script

When my script deals with large input files like 22Gb or 18 GB the basic commands like sort or join fails when run from inside the shell scripts. Can there be any specific reason for this? For e.g. sort -u -t "," -k1,1 a.csv > a.csv.uniq" sort -u -t "," -k1,1 b.csv > b.csv.uniq" The... (3 Replies)
Discussion started by: esha
3 Replies

7. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

8. UNIX for Advanced & Expert Users

How to modify an existing pdf with unix shell commands

Hi, I know that to create a pdf file I can use the txt2pdf command. But if I would change an existing pdf file, by inserting lines in particular positions of this file, what can I use? And How? (3 Replies)
Discussion started by: fandwick
3 Replies

9. UNIX for Dummies Questions & Answers

UNIX Shell Commands Help . . .

I need to know these UNIX Shell Commands with the appropriate parameters. List the files in current directory beginning with extension .har. (% ls .har) View text file "hosts.copy" which spans multiple screens. Execute the batch file "tapeeject.bat" Copy all files from current... (2 Replies)
Discussion started by: pilgrimnoir
2 Replies

10. Shell Programming and Scripting

How to run unix commands in a new shell inside a shell script?

Hi , I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell. So scenario is that - I need to have one shell script which is ran as a part of crontab - in this shell script I need to do a... (2 Replies)
Discussion started by: hkapil
2 Replies
Login or Register to Ask a Question