-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhme.c
More file actions
executable file
·47 lines (40 loc) · 749 Bytes
/
hme.c
File metadata and controls
executable file
·47 lines (40 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include<stdlib.h>
#include<dirent.h>
#include<stdio.h>
#include<string.h>
#include<sys/wait.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<time.h>
#include<sys/types.h>
#include<sys/resource.h>
struct stat statRes;
struct rusage usage;
char command[100],cpy_cmd[100];
char home[100],pwd[100],dir[100],user[256],host[256];
int id;
void ls();
void pd();
void cd();
void username();
void vi();
void vim();
void pinfo2();
void hostname();
void echo();
void showpwd();
void printEveryTime();
void pinfo();
void history();
void addTohist();
extern void hme()
{
char cwd[256];
if (chdir("./") != 0)
perror("chdir() error()");
else {
if (getcwd(home, sizeof(home)) == NULL)
perror("getcwd() error");
}
}