June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
16
Task/Here-document/C/here-document.c
Normal file
16
Task/Here-document/C/here-document.c
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*Abhishek Ghosh, 7th October 2017*/
|
||||
|
||||
#include<stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("\nThe Heredoc task was marked not implementable in C.\
|
||||
\nFrankly the person who did so seems to have little idea of what C\
|
||||
is capable of.\n\
|
||||
After all, what would one call this multiline printf statement ?\
|
||||
I may be old, but do not forget that it all started with me.\
|
||||
\n\nEver enigmatic...\n\
|
||||
C ");
|
||||
|
||||
return 0;
|
||||
}
|
||||
6
Task/Here-document/JavaScript/here-document.js
Normal file
6
Task/Here-document/JavaScript/here-document.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
const myVar = 123;
|
||||
const tempLit = `Here is some
|
||||
multi-line string. And here is
|
||||
the value of "myVar": ${myVar}
|
||||
That's all.`;
|
||||
console.log(tempLit)
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
my $color = 'green';
|
||||
|
||||
my $text = qq :to 'END';
|
||||
say qq :to 'END';
|
||||
some line
|
||||
color: $color
|
||||
another line
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
my $s = Q :array :to 'EOH';
|
||||
my @a = <1 2 3 4>;
|
||||
say Q :array :to 'EOH';
|
||||
123 \n '"`
|
||||
@a$bc
|
||||
@a[]
|
||||
EOH
|
||||
|
||||
dd $s; # OUTPUT«Str $var = "123 \\n '\"`\n \@a\$bc\n 1 2 3 4\n"»
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#!/bin/csh -f
|
||||
cat << ANARBITRARYTOKEN
|
||||
* Your HOME is $HOME
|
||||
* 2 + 2 is `@ n = 2 + 2; echo \$n`
|
||||
ANARBITRARYTOKEN
|
||||
|
||||
cat << 'ANARBITRARYTOKEN'
|
||||
$PATH \$PATH `shutdown now`
|
||||
'ANARBITRARYTOKEN'
|
||||
echo '
|
||||
In any unix shell, you specify a text block and can use all whitespace like
|
||||
(spaces) & (tab) in it, by using single quotes.
|
||||
As mentioned above, a Unix "here document" is a type of redirection.
|
||||
In a literal Bash here document, the starting token must be
|
||||
quoted, but the end token must not, so they are not the same, which does not
|
||||
conform to the task definition.
|
||||
'
|
||||
|
|
|
|||
9
Task/Here-document/UNIX-Shell/here-document-6.sh
Normal file
9
Task/Here-document/UNIX-Shell/here-document-6.sh
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/csh -f
|
||||
cat << ANARBITRARYTOKEN
|
||||
* Your HOME is $HOME
|
||||
* 2 + 2 is `@ n = 2 + 2; echo \$n`
|
||||
ANARBITRARYTOKEN
|
||||
|
||||
cat << 'ANARBITRARYTOKEN'
|
||||
$PATH \$PATH `shutdown now`
|
||||
'ANARBITRARYTOKEN'
|
||||
Loading…
Add table
Add a link
Reference in a new issue