diff --git a/public/blocks/sedBlock.js b/public/blocks/sedBlock.js index c58898c..bf0eaa0 100644 --- a/public/blocks/sedBlock.js +++ b/public/blocks/sedBlock.js @@ -3,7 +3,7 @@ var sedBlock = { category: 'Text processing', unix_description: [ { - regPattern: "'s/patt/", + regPattern: "'s/patt ", singleStr: "'s/str/", regReplaceText: "str/'", regex: '-E', diff --git a/public/img/combine_files.png b/public/img/combine_files.png new file mode 100644 index 0000000..4b06dee Binary files /dev/null and b/public/img/combine_files.png differ diff --git a/public/img/convert_domains.png b/public/img/convert_domains.png new file mode 100644 index 0000000..1594e5f Binary files /dev/null and b/public/img/convert_domains.png differ diff --git a/public/img/extract_columns.png b/public/img/extract_columns.png new file mode 100644 index 0000000..d42f549 Binary files /dev/null and b/public/img/extract_columns.png differ diff --git a/public/img/filter_rows_and_count_lines.png b/public/img/filter_rows_and_count_lines.png new file mode 100644 index 0000000..887f0e3 Binary files /dev/null and b/public/img/filter_rows_and_count_lines.png differ diff --git a/public/img/remove_duplicate_lines_and_sort.png b/public/img/remove_duplicate_lines_and_sort.png new file mode 100644 index 0000000..0b00ff1 Binary files /dev/null and b/public/img/remove_duplicate_lines_and_sort.png differ diff --git a/public/js/en.js b/public/js/en.js index 17f85b7..b2a7fae 100644 --- a/public/js/en.js +++ b/public/js/en.js @@ -834,7 +834,7 @@ Blockly.Msg['WC_TOOLTIP'] = 'word, line, character, and byte count in a file'; Blockly.Msg['WC_HELPURL'] = 'https://www.google.com/'; Blockly.Msg['XARGS'] = 'Execute following command\n for each item'; -Blockly.Msg['XARGS_PLACEHOLDER'] = 'use a palceholder %1'; +Blockly.Msg['XARGS_PLACEHOLDER'] = 'use a placeholder %1'; Blockly.Msg['XARGS_TOOLTIP'] = 'Execute the following command for each item of a list or a file'; Blockly.Msg['XARGS_HELPURL'] = 'https://www.google.com/'; diff --git a/server.js b/server.js index 7e3327d..e3629e1 100644 --- a/server.js +++ b/server.js @@ -177,6 +177,10 @@ app.get('/', (req, res) => { res.render('homePage', { errorMessages: req.flash('error') || [] }); }); +app.get('/tutorials', (req, res) => { + res.render('tutorials', { errorMessages: req.flash('error') || [] }); +}); + app.get('/blockly_unix', addAuthToken, (req, res) => { res.sendFile(path.join(__dirname, 'index.html'), { headers: { 'X-Auth-Token': req.authToken || '' } diff --git a/views/homePage.ejs b/views/homePage.ejs index c250888..39cdf85 100644 --- a/views/homePage.ejs +++ b/views/homePage.ejs @@ -63,7 +63,7 @@ Blockly
+ Filter lines from a file based on a specific condition, sort them, count unique occurrences, and save the top results to a new file. +
++ The corresponding Unix command for this task is: awk -F';' ' $3 == "empt" ' test.txt | sort -r -k2 | uniq -c | head -n 50 > newFile.txt +
++ Remove duplicate lines from a file and then sort the remaining lines. +
++ The corresponding Unix command for this task is: sort inputFile.txt | uniq > outputFile.txt +
++ Filter rows containing the word "error" in a log file. Then count the number of lines that contain the word "error." +
++ The corresponding Unix command for this task is: grep "error" logFile.txt | wc -l +
++ Extract and count domain names from a list of URLs and save the top 15 most frequent domains to a new file. +
++ The corresponding Unix command for this task is: awk -F'/' ' -F'/' {print $3}}' ' urls.txt | sort | uniq -c | sort -r | head -n 15 > topdomains.txt +
++ Concatenate the contents of multiple files into a single file. +
++ The corresponding Unix command for this task is: cat file1.txt file2.txt file3.txt > combinedFile.txt +
++ Extract columns 1 and 3 from a CSV file and save the output to a new file. +
++ The corresponding Unix command for this task is: cut -d',' -f'1,3' file.txt > extracted_columns.txt +
+