Skip to content

Commit

Permalink
corrections to unix hw
Browse files Browse the repository at this point in the history
  • Loading branch information
Tushar authored and Tushar committed Sep 30, 2017
1 parent f660ed5 commit 7e88267
Showing 1 changed file with 33 additions and 20 deletions.
53 changes: 33 additions & 20 deletions day_1_python_and_unix/5_unix_exercises.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,39 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/Users/tushar/Desktop/dse200/DSE200-notebooks/data/NLTK/Chopped\n",
"F0 F115 F131 F148 F164 F180 F198 F214 F230 F36 F52 F68 F83\n",
"F1 F117 F132 F149 F165 F181 F199 F215 F231 F37 F53 F69 F84\n",
"F10 F118 F133 F15 F166 F182 F2 F216 F232 F38 F54 F7 F85\n",
"F100 F119 F134 F151 F167 F183 F20 F218 F233 F39 F55 F70 F86\n",
"F101 F12 F135 F152 F168 F185 F200 F219 F24 F4 F56 F71 F87\n",
"F102 F120 F136 F153 F169 F186 F201 F22 F25 F40 F57 F72 F88\n",
"F104 F121 F137 F154 F170 F187 F202 F220 F26 F41 F58 F73 F9\n",
"F106 F122 F138 F155 F171 F189 F204 F221 F27 F42 F59 F74 F90\n",
"F107 F123 F139 F156 F172 F19 F205 F222 F28 F43 F6 F75 F91\n",
"F108 F124 F14 F157 F173 F190 F206 F223 F29 F44 F60 F76 F93\n",
"F109 F125 F140 F158 F174 F191 F207 F224 F3 F45 F61 F77 F94\n",
"F11 F126 F141 F159 F175 F192 F208 F225 F30 F46 F62 F78 F95\n",
"F110 F127 F142 F16 F176 F193 F209 F226 F31 F48 F63 F79 F96\n",
"F111 F128 F144 F160 F177 F194 F210 F227 F32 F49 F64 F8 F97\n",
"F112 F129 F145 F161 F178 F195 F211 F228 F33 F5 F65 F80 F99\n",
"F113 F13 F146 F162 F179 F196 F212 F229 F34 F50 F66 F81\n",
"F114 F130 F147 F163 F18 F197 F213 F23 F35 F51 F67 F82\n"
]
}
],
"source": [
"%cd ../data/NLTK/Chopped/\n",
"!ls -F"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!cat F* > Fall # start by concatanating all of the files.\n",
"!head Fall"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -51,18 +66,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"#Issue a UNIX command to create a file called Caesar that contains the following lines (include the mistakes!!)\n",
"# A file called Caesar with the following lines is created for you. Use this file for completing the below sub-questions.\n",
"# You can check where the file is being created by !pwd \n",
"\n",
"\n",
"!echo \"\"\"Caesar, a great general, is petitioned by several citizens to show clemency to one of his enemies.\\nHe declines, pompously speaking of himself in the third person. The group of conspirators then proceeds to stab him.\\nWith his dying breath he gasps, \\\"Et tu, Brute? (\\\"And you, Brutus?\\\") Thus falls Caesar.\\\"\\nThe conspirators exult, and Shakespeare inserts a self-referential joke as Cassius says,\\n\\\"How many ages hence shall this our lofty scene be acted over in states unborn and accents yet unknown!\"\"\" >> Caesar.txt\n",
"\n",
"Text = \"\"\"Caesar, a great general, is petitioned by several citizens to show clemency to one of his enemies.\n",
"He declines, pompously speaking of himself in the third person. The group of conspirators then proceeds to stab him.\n",
"With his dying breath he gasps, \"Et tu, Brute? (\"And you, Brutus?\") Thus falls Caesar.\" \n",
"The conspirators exult, and Shakespeare inserts a self-referential joke as Cassius says, \n",
"\"How many ages hence shall this our lofty scene be acted over in states unborn and accents yet unknown!\"\n",
"\"\"\"\n",
"\n",
"#Change the permissions of this file to 666\n",
"#Issue a UNIX command to determine the file type\n",
Expand Down

0 comments on commit 7e88267

Please sign in to comment.