-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShellCmd.h
More file actions
31 lines (28 loc) · 770 Bytes
/
ShellCmd.h
File metadata and controls
31 lines (28 loc) · 770 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
#ifndef SHELLCMD_H
#define SHELLCMD_H
#include <string>
#include <iostream>
#include <unistd.h>
#include <fstream>
#include <cstring>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h> // exit
#include <sys/types.h>
#include <sys/wait.h>
class ShellCmd{
private:
//Runs user command from a list of commands
static void runCmd(char**);
//Changes the current working directory
static void chngDir(char**);
public:
//Finds the current working directory
static void curDir(int);
//Runs a child command based on whether input, output, or a pipe is needed for input output redirection
static void runChild(char**);
static void runChild(char**, int&, bool);
static void runChild(char**, int&, int&);
static void runChild(char**, int*);
};
#endif