We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46cde67 commit 47aedd5Copy full SHA for 47aedd5
1 file changed
src/rshell.cpp
@@ -15,6 +15,23 @@ int main()
15
{
16
while(true)
17
18
+ if(NULL == getlogin())//Display login user
19
+ {
20
+ perror("getlogin");
21
+ }
22
+ else
23
24
+ cout << getlogin();
25
26
+ char host_name[64] ={0};
27
+ if(-1 == gethostname(host_name,64))//Display host name
28
29
+ perror("hostname");
30
31
32
33
+ cout << "@" << host_name;
34
35
string commands;//Receive command line
36
cout << "$";
37
getline(cin,commands);
0 commit comments