diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /1088/CH4/EX4.6/Example6.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '1088/CH4/EX4.6/Example6.sce')
-rwxr-xr-x | 1088/CH4/EX4.6/Example6.sce | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/1088/CH4/EX4.6/Example6.sce b/1088/CH4/EX4.6/Example6.sce new file mode 100755 index 000000000..2bb3b2573 --- /dev/null +++ b/1088/CH4/EX4.6/Example6.sce @@ -0,0 +1,42 @@ +clear +mode(-1) +pwd +cwd=ans +t=tokens(cwd,'\') +par=strcat(t(1:(size(t,'r')-1)),'\') +clc + +printf("Example 6 : Show the use of relative pathname .. by going to the parent of the current directory \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") + +printf("\n\n$ pwd #To get the value of the current directory\n\n") +halt("........# (hit [ENTER] for result)") +clc(1) +printf(" %s \n",cwd) +halt("........# (hit [ENTER] for next instruction)") + +printf("\n\n\n$ cd .. #To go to the current directory\n\n") +halt("........# (hit [ENTER] for next instruction)") +clc(1) +cd(par) + +printf("\n\n\n$ pwd \n\n") +halt("........# (hit [ENTER] for result)") +clc(1) +printf(" %s \n",par) +halt("........# (hit [ENTER] for next instruction)") + +printf("\n\n\n$ exit #To exit the current simulation terminal and return to Scilab console\n\n") +halt("........# (hit [ENTER] for result)") +cd(cwd) +//clc() + +printf("\n\n\t\t\tBACK TO SCILAB CONSOLE...\nLoading initial environment') +sleep(1000) |