summaryrefslogtreecommitdiff
path: root/1088/CH1/EX1.4/Example4.sce
diff options
context:
space:
mode:
Diffstat (limited to '1088/CH1/EX1.4/Example4.sce')
-rwxr-xr-x1088/CH1/EX1.4/Example4.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/1088/CH1/EX1.4/Example4.sce b/1088/CH1/EX1.4/Example4.sce
new file mode 100755
index 000000000..60c28fabc
--- /dev/null
+++ b/1088/CH1/EX1.4/Example4.sce
@@ -0,0 +1,22 @@
+clear
+clc
+
+disp("Example 4 : Display all the current users in the Current Unix Session")
+disp('')
+printf("\n*******************************************************************\n")
+disp("Answer :")
+printf("THE FOLLOWING LINES OF CODE RUN \nONLY IN SCILAB INSTALLED IN UNIX ENVIRONMENT.....")
+printf("\nTHE CONSOLE GETS EXITED IN OTHER\n OPERATING SYSTEMS")
+if(getos() ~= "Linux" )then
+ disp("")
+ halt('Press any key to end the script since the OS is not Linux')
+ printf("Close the Scilab Console?....\ny :Yes\nAny other key:No")
+ st = input('','s')
+ clc(1)
+ if( st == "y") then
+ exit
+ end
+else
+ unix_w("who")
+end
+printf("\n*******************************************************************\n")