diff options
Diffstat (limited to '1088/CH5/EX5.3')
-rwxr-xr-x | 1088/CH5/EX5.3/Example3.sce | 63 | ||||
-rwxr-xr-x | 1088/CH5/EX5.3/Result3.pdf | 54 | ||||
-rwxr-xr-x | 1088/CH5/EX5.3/Result3.txt | 54 |
3 files changed, 171 insertions, 0 deletions
diff --git a/1088/CH5/EX5.3/Example3.sce b/1088/CH5/EX5.3/Example3.sce new file mode 100755 index 000000000..fdd177a96 --- /dev/null +++ b/1088/CH5/EX5.3/Example3.sce @@ -0,0 +1,63 @@ +clear
+flag=1
+mode(-1)
+clc
+
+
+printf("Example 3 : Show the method of removing files in unix using the rm command \n")
+disp("****************************************************************")
+disp("Answer : ")
+disp("INSTRUCTIONS : ")
+printf("\nHere all instructions are preloaded in the form of a demo\nPRESS ENTER AFTER EACH COMMAND to see its RESULT\nPRESS ENTER AFTER EACH RESULT TO GO TO THE NEXT COMMAND\n")
+halt('.............Press [ENTER] to continue.....')
+halt("")
+clc
+printf("\tUNIX SHELL SIMULATOR(DEMO VERSION WITH PRELOADED COMMANDS)\n\n\n")
+src=input("# Enter the name of the file which you want to delete : ",'s')
+
+flag=0
+printf("\n $ rm %s \t#deletes file %s\n",src,src)
+halt('')
+
+
+if isfile(src) then
+ printf('rm : remove %s (yes/no)? ? ',src)
+ resp=input(' ','s')
+ if resp=='y' then
+ mdelete(src)
+ flag=1
+ end
+ else
+ printf("\n%s : file not found \n",src)
+end
+
+if flag then
+ printf("\n $ cat %s # opening file %s to see if it exists \n",src,src)
+ if ~isfile(src) then
+ printf("\n%s : file not found \n ",src)
+ else
+
+ printf("\n ===========> %s <============\n\n\n",destn)
+ fhdr=mopen(destn,'rt')
+ while %t
+ [n,a]=mfscanf(fhdr,"%c")
+ if meof(fhdr) then
+ break
+ end
+ printf("%c",a)
+ i=i+1
+ end
+ mclose(fhdr)
+ printf("\n\n%d characters present in the file.\n[hit ENTER to continue]\n",i)
+ halt('')
+
+ end
+end
+
+
+printf("\n\n\n$ exit #To exit the current simulation terminal and return to Scilab console\n\n")
+halt("........# (hit [ENTER] for result)")
+//clc()
+
+printf("\n\n\t\t\tBACK TO SCILAB CONSOLE...\nLoading initial environment')
+sleep(1000)
diff --git a/1088/CH5/EX5.3/Result3.pdf b/1088/CH5/EX5.3/Result3.pdf new file mode 100755 index 000000000..1ae2a372e --- /dev/null +++ b/1088/CH5/EX5.3/Result3.pdf @@ -0,0 +1,54 @@ + ans =
+
+ 1.
+
+-->exec("Example3.sci",-1)
+Current date is 05-Jun-2013
+
+Welcome to the Textbook Companionship Project 2013
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Book Title : UNIX CONCEPTS AND APPLICATIONS
+
+ Book Edition : 4
+
+ Book Author : Sumitabha Das
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Code Author : Pranav Bhat T
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Chapter Number : 5
+
+ Chapter Title : HANDLING ORDINARY FILES
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+Example 3 : Show the method of removing files in unix using the rm command
+
+ ****************************************************************
+
+ Answer :
+
+ INSTRUCTIONS :
+
+Here all instructions are preloaded in the form of a demo
+PRESS ENTER AFTER EACH COMMAND to see its RESULT
+PRESS ENTER AFTER EACH RESULT TO GO TO THE NEXT COMMAND
+.............Press [ENTER] to continue..... UNIX SHELL SIMULATOR(DEMO VERSION WITH PRELOADED COMMANDS)
+
+
+
+ $ rm hithere #deletes file hithere
+rm : remove hithere (yes/no)? ?
+ $ cat hithere # opening file hithere to see if it exists
+
+hithere : file not found
+
+
+
+$ exit #To exit the current simulation terminal and return to Scilab console
+
+........# (hit [ENTER] for result)
+
+ BACK TO SCILAB CONSOLE...
+Loading initial environment
+-->diary(0)
diff --git a/1088/CH5/EX5.3/Result3.txt b/1088/CH5/EX5.3/Result3.txt new file mode 100755 index 000000000..1ae2a372e --- /dev/null +++ b/1088/CH5/EX5.3/Result3.txt @@ -0,0 +1,54 @@ + ans =
+
+ 1.
+
+-->exec("Example3.sci",-1)
+Current date is 05-Jun-2013
+
+Welcome to the Textbook Companionship Project 2013
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Book Title : UNIX CONCEPTS AND APPLICATIONS
+
+ Book Edition : 4
+
+ Book Author : Sumitabha Das
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Code Author : Pranav Bhat T
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Chapter Number : 5
+
+ Chapter Title : HANDLING ORDINARY FILES
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+Example 3 : Show the method of removing files in unix using the rm command
+
+ ****************************************************************
+
+ Answer :
+
+ INSTRUCTIONS :
+
+Here all instructions are preloaded in the form of a demo
+PRESS ENTER AFTER EACH COMMAND to see its RESULT
+PRESS ENTER AFTER EACH RESULT TO GO TO THE NEXT COMMAND
+.............Press [ENTER] to continue..... UNIX SHELL SIMULATOR(DEMO VERSION WITH PRELOADED COMMANDS)
+
+
+
+ $ rm hithere #deletes file hithere
+rm : remove hithere (yes/no)? ?
+ $ cat hithere # opening file hithere to see if it exists
+
+hithere : file not found
+
+
+
+$ exit #To exit the current simulation terminal and return to Scilab console
+
+........# (hit [ENTER] for result)
+
+ BACK TO SCILAB CONSOLE...
+Loading initial environment
+-->diary(0)
|