Improve my shell by adding hierarchical directories.


 
Thread Tools Search this Thread
Top Forums Programming Improve my shell by adding hierarchical directories.
# 1  
Old 10-31-2009
Question Improve my shell by adding hierarchical directories.

Hi.

im learning unix, and i have problem with my shell . i want to add hierarchical directories. so theshell have mkdir, rmdir and chdir commands.

the coding in C language.

i looked at the source of mkdir for example, and its very long and complicated. i need simple implementation for these functions to add them to my shell, so i can make directories for example while inside the shell !

Thanks
# 2  
Old 10-31-2009
Hi.

The shell (well actually the OS) has programs to create (mkdir), remove (rmdir) and change (cd) directories.

Beyond that, I'm not sure what you're asking.

What do you mean by "my shell"? And what has C got to do with any of this?
# 3  
Old 10-31-2009
this is the shell

Last edited by evantheking; 10-31-2009 at 09:17 PM..
# 4  
Old 10-31-2009
If anyone is to help you, you have to start making some sense.

The file you uploaded is 2 bytes in size - about as much use as a trap door in a lifeboat.

If you're trying to do something in C why are you talking about shells? And why are you looking at the source code for mkdir, etc., when all you have to do is call it?

And what does learning UNIX have to do with writing a C program?
# 5  
Old 11-01-2009
fixed the link
# 6  
Old 11-02-2009
The source code for many home-brewed interactive shells is available on the Internet. You just need to search for it.

If you want to look at the source code for the Bourne shell, it is available at V7 Bourne Shell source code
# 7  
Old 11-03-2009
Quote:
Originally Posted by fpmurphy
The source code for many home-brewed interactive shells is available on the Internet. You just need to search for it.

If you want to look at the source code for the Bourne shell, it is available at V7 Bourne Shell source code
there is no chdir mkdir ..etc in that shell
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding Two Array in shell script

Hi Experts, I've got this problem where I need to add two array in shell script such that that is an element is greater than 9 then it get further split into individual digit, something like below : Input :- array1=(2 6 8 9 10 12) array2=(5 4 6 8 12 14) Output :- array3=(7 1 0 1 4 1 7 2 2... (8 Replies)
Discussion started by: mukulverma2408
8 Replies

2. HP-UX

Adding Directories to PATH in HP-UX with csh

HI Guys, I am truing to add some directories to the productive HP-UX (like /usr/sbin) the problem is that i tried some methods like (export) and setenv but i failed. I add some logs output of the commands to provide you with more info . the user which I am trying to add this path is different... (5 Replies)
Discussion started by: barry1946
5 Replies

3. Shell Programming and Scripting

Parse Hierarchical line

Hi, I have one Hierarchical text file. Content shown below 01|abcd|vbgh 02|test1|test2|testx 02|test23|test343|ddfd45 03|7676|8787|8989 01|bcdf|hjc 02|testds|sddsf|sdfdsf 03|sdfsd|sdfsdf|sfsd 03|ssdfdsf|sdsdfsdfds|sdfsf 02|sdfdf|sddsfs|sdfsdf ... (1 Reply)
Discussion started by: Anupam_Halder
1 Replies

4. UNIX for Dummies Questions & Answers

[please] improve my shell/SQL*Plus script

Hi We generate with PL/SQL *.csv files, archive them and mail to the customer. Here is my script (Solaris 10, ksh): #!/bin/ksh # Unix Shell Script Structure for PL/SQL queries with SQL*Plus . ~/.profile scriptdir=/opt/ora/scripts queryname1=example... (1 Reply)
Discussion started by: slashdotweenie
1 Replies

5. Shell Programming and Scripting

renaming directories with shell script

Hi All after looking around the website and various other resources I become stuck. I'm trying to rename directories from Firstname Initial Lastname to lastname,_firstname_initial so far ive got for f in {./} do rename -n 'y/A-Z/a-z/' * rename -n 's/\ /_/g' * ... (2 Replies)
Discussion started by: harlequin
2 Replies

6. Shell Programming and Scripting

dynamically adding values in c-shell

I am needing to create a variable(changing) and assign it a value(changing) ... I am using C-Shell.. Example: foreach account in ($Accountlist) set account_connect = "$account/$account_pass" end I want to make set account_connect to store various values ? $account_connect did not... (3 Replies)
Discussion started by: shafi2all
3 Replies

7. Shell Programming and Scripting

Improve the performance of a shell script

Hi Friends, I wrote the below shell script to generate a report on alert messages recieved on a day. But i for processing around 4500 lines (alerts) the script is taking aorund 30 minutes to process. Please help me to make it faster and improve the performace of the script. i would be very... (10 Replies)
Discussion started by: apsprabhu
10 Replies

8. Shell Programming and Scripting

Help with Shell Script displaying Directories

I am new to shell programming and have an assignment question which requires me to list the contents of the present working directory in 4 column format and highlight any subdirectories. It then requires me to develop the shell script to accept a directory name as a positional parameter (if no... (11 Replies)
Discussion started by: cjnd1988
11 Replies

9. Shell Programming and Scripting

Adding options to a shell script

I want to add options to my shell script but having problems, my code so far is; #!/bin/bash lflag= iflag= while getopts 'l:i:' OPTION do case $OPTION in l) lflag=1 lval="$OPTARG" ;;... (1 Reply)
Discussion started by: paulobrad
1 Replies

10. Shell Programming and Scripting

Adding -options to shell scripts

I'm sure this is something simple I am overlooking somehow. I'd like the ability to pass -options into my shell scripts. For example my file called "input.sh" I can do the following: root# ./input.sh 1 and it will result: root#./input.sh 1 You passed me a 1 Just like an init script, etc.... (4 Replies)
Discussion started by: sysera
4 Replies
Login or Register to Ask a Question