#include <stdio.h>
#include <stdlib.h>
void welcome();
void options();
void user();
void date();
void ip();
void list();
void path();
void newfolder();
int main()
{
welcome();
options();
char choice = '0';
while(choice != '9'){
if(choice != '\n')
printf("Aneebs's Shell#: ");
scanf("%c",&choice);
if(choice == '0')
options();
else if(choice == '1')
user();
else if(choice == '2')
date();
else if(choice == '3')
ip();
else if(choice == '4')
list();
else if(choice == '5')
path();
else if(choice == '6')
newfolder();
else if(choice == '9')
exit(0);
if(choice != '\n')
printf("\n");
}
return 0;
}
void welcome()
{
printf(" # \n");
printf(" ## ## \n");
printf(" ### ### \n");
printf(" ### ### \n");
printf(" ### ### \n");
printf(" ############### \n");
printf(" ### ### \n");
printf(" ### ### \n");
printf(" ### ### #\n");
printf(" ### ### ####\n");
printf(" ### ##hmad Jajja's ## ##gri Shell\n");
printf("Type command number to execute commands that are given below...\n");
}
void options()
{
printf("\nCommands to execute...\n\n");
printf("0. OPTIONS\n");
printf("1. Check current username\n");
printf("2. Check current date and time\n");
printf("3. Check ip address of the machine\n");
printf("4. List content of current directory\n");
printf("5. Check current working directory path\n");
printf("6. Create new folder\n");
printf("9. Exit\n\n");
}
void user()
{
printf("\n");
system("whoami");
}
void date()
{
printf("\n");
system("date");
}
void ip()
{
printf("\n");
system("ip route");
}
void list()
{
printf("\n");
system("ls");
}
void path()
{
printf("\n");
system("pwd");
}
void newfolder()
{
printf("\nEnter new folder name: ");
char foldername[30];
scanf("%s", foldername);
char command[40];
snprintf(command, sizeof command, "mkdir %s", foldername);
system(command);
}
agri-shell-code-in-c's Introduction
agri-shell-code-in-c's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.