summaryrefslogtreecommitdiff
path: root/1088/CH1/EX1.7/Example7.sce
diff options
context:
space:
mode:
Diffstat (limited to '1088/CH1/EX1.7/Example7.sce')
-rwxr-xr-x1088/CH1/EX1.7/Example7.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/1088/CH1/EX1.7/Example7.sce b/1088/CH1/EX1.7/Example7.sce
new file mode 100755
index 000000000..942d7d51f
--- /dev/null
+++ b/1088/CH1/EX1.7/Example7.sce
@@ -0,0 +1,22 @@
+
+clear
+clc
+
+disp("Example 6 : Display the number of files in the current directory ")
+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("ls|wc")
+end
+printf("\n*******************************************************************\n")