lab2

parent 71303707
Three idiots
1 - Rama Mahidhar Reddy Kancharla (160050091)
2 - Sai Praneeth Reddy ( 160050100)
5 - Shantanu Kumar (160050069)
3 & 4 all three collaborated in searching and writing the code
#!/bin/bash
let "a = $1"
let "b = a+1"
let "c=a"
let "d=b*c"
let "e=d/2"
echo $e
\ No newline at end of file
./script1.sh 5 >> out
./script1.sh 10 >> out
./script1.sh 20 >> out
diff out output/testcase >> result
if [[ -s result ]];
then
echo fail
else
echo success
fi
rm out result
#!/bin/bash
echo $(ls -l $1 | grep -c ^d)
\ No newline at end of file
mkdir testcase
mkdir testcase/test1
mkdir testcase/test2
mkdir testcase/test1\ test2/
./script2.sh testcase > out
echo 3 > tc
diff out tc > result
if [[ -s result ]];
then
echo fail
else
echo success
fi
rm -r testcase
rm tc out result
#!/bin/bash
myvar=$(cat $1)
for value in $myvar
do
if [ -d $value ]
then
echo could not create $value
else
mkdir $value
echo created $value
fi
done
./script3.sh testcase/input1 > out
diff out testcase/output1 >> result
rm -r test1 test2
./script3.sh testcase/input2 > out
diff out testcase/output2 >> result
rm -r test1 test2 test3
if [[ -s result ]];
then
echo fail
else
echo success
fi
rm out result
created test1
created test2
could not create test1
created test1
created test2
created test3
#!/bin/bash
var=$(cat $1)
max1=$( echo $var | cut -d' ' -f 1 )
max2=$( echo $var | cut -d' ' -f 2 )
i=3
n=$( wc -w $1 | cut -d' ' -f 1)
while [ $i -le $n ]
do
num1=$( echo $var | cut -d' ' -f $i )
((i++))
if [ $max1 -lt $num1 ]
then
temp=$max1
max1=$num1
max2=$temp
num1=-1
fi
if [ $max2 -lt $num1 ]
then
max2=$num1
fi
done
echo $(expr $max2 + $max1)
echo $(expr $max2 \* $max1)
./script4.sh testcase/input1 >> out
./script4.sh testcase/input2 >> out
./script4.sh testcase/input3 >> out
diff out testcase/output >> result
if [[ -s result ]];
then
echo fail
else
echo success
fi
rm out result
30 79 83 77 7 12 61 16 92 27 19 47 39 72 0 94 24 36 32 34 0 87 78 20 2 25 81 38 66 70 70 97 1 5 26 9 18 87 77 62 15 96 9 6 21 61 0 97 50 85
\ No newline at end of file
966 822 958 943 12 611 862 694 740 795 602 520 494 837 937 822 703 298 545 369 921 466 835 917 415 208 362 223 131 98 178 449 920 489 745 284 452 607 330 192 402 285 712 248 122 1 423 825 652 968 547 573 786 734 842 202 295 204 777 426 302 307 227 575 796 972 859 249 579 542 793 333 827 858 582 949 211 5 775 863 973 674 788 759 408 630 313 703 834 90 481 489 398 709 64 546 681 275 147 613
\ No newline at end of file
21971 82218 57150 60531 7171 5488 37570 56187 22386 92198 66073 81525 19617 91763 27274 78605 62649 13756 30795 13318 30399 31293 10187 89654 48192 26083 42324 38169 54175 45687 87776 92498 44258 44926 53029 67781 50415 6951 23968 89153 99150 6394 87030 35119 98157 14304 13724 77158 44412 60871 90476 74812 92164 17015 80818 56708 43099 23143 11230 13626 85182 99006 6124 45792 43932 75505 13573 10699 82456 53894 16204 81606 60288 19587 33077 74797 50243 46801 51955 94656 24024 58783 85820 32541 75799 82990 89249 35250 22485 16831 65228 7668 32189 71352 69812 92474 63209 83386 3173 62017 37280 35730 59976 13920 55317 93053 88717 21912 39855 57024 32920 80231 32159 18740 12772 7958 18083 18374 59560 40568 51557 24788 48236 83747 12492 18049 76221 75701 17787 95746 37719 71419 31476 97695 85339 3145 90748 90408 25058 46955 63784 57978 43539 95943 93071 56311 20254 11154 91037 79814 51722 42595 20955 16311 26342 33447 50712 2563 25501 84851 14661 79572 56270 46138 93619 57961 65635 719 64721 7045 64027 28505 81376 7566 40800 90799 63877 61054 18305 71267 57221 86379 13862 94528 2690 40204 27975 69754 59119 69828 54605 90132 49400 27227 52622 59371 85188 18258 60091 49909 41655 24118 94766 23031 48036 35567 13830 11913 12973 32135 99532 70194 18515 13394 64722 37557 69950 9050 23664 45421 95230 94621 35554 60983 21849 88176 20354 7037 22786 80445 73299 64442 20915 68065 87473 68951 19984 17656 97217 32958 66143 96749 3152 1010 26496 84227 54920 96446 93277 78584 58220 4859 73205 93774 65842 95054 98302 86197 18444 21089 82994 8095 85531 3910 92512 89356 89213 12497 23364 2782 45455 5860 15884 64959 6870 42380 49186 61790 38826 58815 56726 97046 63675 29932 7172 29517 41338 5475 32066 76134 42916 15061 84229 44799 35323 76742 50507 40888 5591 73872 43671 51046 79732 59555 16005 2954 1935 81544 64745 57113 40359 37823 70512 20386 67755 94036 49904 25446 99511 98322 17932 58779 13383 18514 3578 65058 11608 54086 5947 17199 44310 49618 68245 40394 25525 602 43348 43812 82146 24445 925 22506 62269 87789 59244 46376 81826 9148 88174 97689 23823 6107 56469 37206 24621 60047 18617 52581 14133 24564 69780 74795 90534 54377 15189 16059 54979 58538 76223 37126 99335 77148 75984 61604 81290 35228 7981 63116 60729 12507 60805 84552 18614 17274 38110 59587 77322 56727 12168 7807 97643 81948 82603 88177 52677 14144 20588 7657 72682 96811 61135 72018 90312 37119 49974 71602 88699 74307 51070 49428 86815 11875 50332 21781 45502 88443 81369 39176 61522 9889 63335 59166 91838 45938 47343 44515 76435 84284 68524 65469 81095 29659 37487 87759 83130 3814 75713 71830 78121 26783 37610 81288 55011 87943 3070 513 92738 84439 56041 54260 94328 19376 29778 2518 81667 93474 63386 58102 77758 48262 23571 75205 77922 77411 79317 61052 81225 55030 49234 75698 98166 86845 56987 53177 74788 60057 70042 83878 60848 26083 54490 71528 45459 84269 74047 27126 77743 53785 1580 71853 2047 25152 47058 96321 18915 26375 73726 140 97758 22960 92190 95924 9805 49177 49101 945 25586 35495 84823 86434 61578 55666 74315 23389 39935 48362 66868 34030 18499 68448 5883 36898 93600 69293 33220 12515 12021 6946 29007 9779 46258 21198 22055 72416 86727 87508 73361 28666 23003 74537 31452 84581 30203 5767 7970 86490 70481 74838 20520 88980 59639 42755 42231 69591 12048 75451 98459 40421 98749 27466 50200 61359 65016 88607 33775 68096 76115 7137 96762 99118 98026 28214 51 28229 33982 24374 31071 4463 15564 51591 9796 75203 94346 52027 44795 22746 43830 43254 63168 58931 87072 29720 20290 52089 18328 54066 36537 94443 77555 33299 93562 75581 77865 9965 20162 11847 34339 51233 32663 49904 2824 42459 25107 13522 10838 69902 52620 54668 29508 15788 13599 16581 61861 33889 85022 80189 4307 21559 90984 81862 71210 898 57443 49075 10864 77605 60923 45203 28838 93586 95107 48014 52397 36567 77888 63235 22821 30509 17903 52330 62649 47854 68911 24510 98095 70285 21051 2403 91844 28388 84265 63054 29286 41709 12129 56502 19314 89404 18058 64505 99342 29517 28871 68091 66084 6760 31326 88906 53621 65581 57588 16270 29787 42851 57133 27883 13136 94536 30286 4980 22924 14551 84386 68563 56260 12867 25065 91927 18624 43123 72784 17966 72641 1655 86058 55077 24767 33736 60335 78388 15670 17923 11011 45457 60774 84496 73340 73910 79032 3626 95242 18309 18178 79628 3224 90790 8848 28289 99069 27472 87765 71853 61790 76758 89861 64200 31835 14628 97937 8523 93017 13607 26446 20380 75416 87221 4876 48757 61131 260 68735 56374 34921 86913 52354 38145 94056 77554 66435 93125 5026 70552 64979 66817 63662 54840 31017 11849 85820 45306 20372 95189 75265 46819 15569 50682 34040 36797 15791 11523 53410 84526 84249 88331 71440 36604 26477 81848 30510 9264 74973 35537 79816 56304 18706 43478 27496 66075 71679 13317 27734 92052 8506 2999 38871 40428 70033 89263 93577 85824 786 46987 70351 85036 35319 58143 37992 61796 39991 68502 71060 31316 20391 67228 87621 55449 27058 15117 37877 98737 44786 65611 90789 69645 68610 29660 26425 38644 35275 20002 40820 36062 66990 11171 37450 18661 85666 91794 80457 25657 76648 67869 56974 97040 35097 60947 68841 62155 92416 6718 60892 53555 72329 68034 23200 57292 14046 49625 12288 49322 85979 53108 1736 69321 80632 39186 87982 66298 30980 84791 8308 7628 52660 81634 21020 4109 42581 89862 82616 34997 12932 59861 88552 1614 27895 28104 58906 41941 94081 87546 7615 80061 57006 9351 49382 37638 64889 53717 20289 95869 38508 28597 19850 91169 10231 40870 11630 52812 47084 94247 4161 60017 54108 9066 61631 98355 53522 36889 56648 47604 24435 64264 44017 97793 89967 93399 35432 54857 47116 55721 67078 1977 670 86928 93146 10901 44151 21128 80065 91235 15375 578 67604 85835 9644 29235 84190 79519 82476 57191 27123 6911 21455 71140 21057 27774 80891 56489 82631 44360 28562 49710 46337 45584 36638 55835 56485 80789 76963 52902 88377 8691 53480 55981 94526 79477 1569 95069 58996 84045 52260 2471 7309 90067 73611 28366 17841 70854 1207 16825
194
9409
1945
945756
198682
9868597800
#!/bin/bash
myvar=$1
sed -i 's/\bmighty\b/dumb/I' $myvar
./script5.sh testcase/input > out
diff out testcase/output > result
if [[ -s result ]];
then
echo fail
else
echo success
fi
rm out result
Thor is a 2011 American superhero film based on the Marvel Comics character of the same name, produced by Marvel Studios and distributed by Paramount Pictures.[N 1] It is the fourth film in the Marvel Cinematic Universe. The film was directed by Kenneth Branagh, written by Ashley Edward Miller & Zack Stentz and Don Payne, and stars Chris Hemsworth, Natalie Portman, Tom Hiddleston, Stellan Skarsgård, Colm Feore, Ray Stevenson, Idris Elba, Kat Dennings, Rene Russo and Anthony Hopkins. The film sees Thor, the crown prince of Asgard, banished to Earth and stripped of his powers after he reignites a dormant war. As his brother, Loki, plots to take the throne for himself, Thor must prove himself worthy and reclaim his hammer Mjolnir.
Sam Raimi first developed the concept of a film adaptation of Thor in 1991, but soon abandoned the project, leaving it in "development hell" for several years. During this time, the rights were picked up by various film studios until Marvel Studios signed Mark Protosevich to develop the project in 2006, and planned to finance it and release it through Paramount Pictures. Matthew Vaughn was originally assigned to direct the film for a tentative 2010 release. However, after Vaughn was released from his holding deal in 2008, Branagh was approached and the film's release was rescheduled into 2011. The main characters were cast in 2009, and principal photography took place in California and New Mexico from January to May 2010. The film was converted to 3D in post-production.
Thor premiered on April 17, 2011, in Sydney, Australia and was released on May 6, 2011, in the United States. The film was a financial success and received positive reviews from film critics. The DVD and Blu-ray sets were released on September 13, 2011. A sequel, Thor: The Dark World, was released on November 8, 2013. A third film, Thor: Ragnarok, is set to be released on November 3, 2017.
In 965 AD, Odin, king of Asgard, wages war against the Frost Giants of Jotunheim and their leader Laufey, to prevent them from conquering the nine realms, starting with Earth. The Asgardian warriors defeat the Frost Giants and seize the source of their power, the Casket of Ancient Winters.
In the present,[N 2] Odin's son Thor prepares to ascend to the throne of Asgard, but is interrupted when Frost Giants attempt to retrieve the Casket. Against Odin's order, Thor travels to Jotunheim to confront Laufey, accompanied by his brother Loki, childhood friend Sif and the Warriors Three: Volstagg, Fandral, and Hogun. A battle ensues until Odin intervenes to save the Asgardians, destroying the fragile truce between the two races. For Thor's arrogance, Odin strips his son of his godly power and exiles him to Earth as a mortal, accompanied by his hammer Mjolnir, now protected by an enchantment that allows only the worthy to wield it.
Thor lands in New Mexico, where astrophysicist Dr. Jane Foster, her assistant Darcy Lewis, and mentor Dr. Erik Selvig, find him. The local populace finds Mjolnir, which S.H.I.E.L.D. agent Phil Coulson soon commandeers before forcibly acquiring Jane's data about the wormhole that delivered Thor to Earth. Thor, having discovered Mjolnir's nearby location, seeks to retrieve it from the facility that S.H.I.E.L.D. quickly constructed but he finds himself unable to lift it, and is captured. With Selvig's help, he is freed and resigns himself to exile on Earth as he develops a romance with Jane.
Loki discovers that he is Laufey's biological son, adopted by Odin after the war ended. A weary Odin falls into the deep "Odinsleep" to recover his strength. Loki seizes the throne in Odin's stead and offers Laufey the chance to kill Odin and retrieve the Casket. Sif and the Warriors Three, unhappy with Loki's rule, attempt to return Thor from exile, convincing Heimdall, gatekeeper of the Bifröst—the means of traveling between worlds—to allow them passage to Earth. Aware of their plan, Loki sends the Destroyer, a seemingly indestructible automaton, to pursue them and kill Thor. The warriors find Thor, but the Destroyer attacks and defeats them, prompting Thor to offer himself instead. Struck by the Destroyer and near death, Thor's sacrifice proves him worthy to wield Mjolnir. The hammer returns to him, restoring his powers and enabling him to defeat the Destroyer. Kissing Jane goodbye and vowing to return, he and his fellow Asgardians leave to confront Loki.
In Asgard, Loki betrays and kills Laufey, revealing his true plan to use Laufey's attempt on Odin's life as an excuse to destroy Jotunheim with the Bifröst Bridge, thus proving himself worthy to his adoptive father. Thor arrives and fights Loki before destroying the Bifröst Bridge to stop Loki's plan, stranding himself in Asgard. Odin awakens and prevents the brothers from falling into the abyss created in the wake of the bridge's destruction, but Loki allows himself to fall when Odin rejects his pleas for approval. Thor makes amends with Odin, admitting he is not ready to be king; while on Earth, Jane and her team search for a way to open a portal to Asgard.
In a post-credits scene, Selvig has been taken to a S.H.I.E.L.D. facility, where Nick Fury opens a briefcase and asks him to study a mysterious cube-shaped object,[N 3] which Fury says may hold untold power. An invisible Loki prompts Selvig to agree, and he does.
The crown prince of Asgard, based on the Norse mythological deity of the same name. Director Kenneth Branagh and Marvel Studios chief Kevin Feige chose Hemsworth after a back-and-forth process in which the 27-year-old actor was initially dropped from consideration and then given a second chance to read for the part.[11] Hemsworth stated that he gained 20 pounds for the role by eating non-stop and revealed that "It wasn't until Thor that I started lifting weights, it was all pretty new to me."[12] Regarding his take on the character, Hemsworth said, "We just kept trying to humanize it all, and keep it very real. Look into all the research about the comic books that we could, but also bring it back to 'Who is this guy as a person, and what's his relationship with people in the individual scenes?'"[13] About approaching Thor's fighting style, he remarked, "First, we looked at the comic books and the posturing, the way [Thor] moves and fights, and a lot of his power seems to be drawn up through the ground. We talked about boxers, you know, Mike Tyson, very low to the ground and big open chest and big shoulder swings and very sort of brutal but graceful at the same time, and then as we shot stuff things became easier."[14] Dakota Goyo portrays a young Thor.
A scientist and Thor's love interest. Marvel Studios stated in an announcement that the character was updated from the comics' initial portrayal for the feature adaptation.[15] When asked why she took the role, Portman replied, "I just thought it sounded like a weird idea because Kenneth Branagh's directing it, so I was just like, 'Kenneth Branagh doing Thor is super-weird, I've gotta do it.'"[16] Portman stated that she really wanted to do a big effects film that emphasized character, and getting to do it with Branagh was a new way of approaching it, relative to Star Wars.[17] Regarding her preparation for the role Portman remarked, "I signed on to do it before there was a script. And Ken, who's amazing, who is so incredible, was like, 'You can really help create this character'. I got to read all of these biographies of female scientists like Rosalind Franklin who actually discovered the DNA double helix but didn't get the credit for it. The struggles they had and the way that they thought – I was like, 'What a great opportunity, in a very big movie that is going to be seen by a lot of people, to have a woman as a scientist'. She's a very serious scientist. Because in the comic she's a nurse and now they made her an astrophysicist. Really, I know it sounds silly, but it is those little things that makes girls think it's possible. It doesn't give them a [role] model of 'Oh, I just have to dress cute in movies'".[18]
Thor's adoptive brother and nemesis based on the deity of the same name. Hiddleston was chosen after previously working with Branagh on Ivanov and Wallander.[19] Initially, Hiddleston auditioned to play Thor but Branagh decided his talent would be better harnessed playing Loki. Hiddleston stated that, "Loki's like a comic book version of Edmund in King Lear, but nastier." Hiddleston stated that he had to keep a strict diet before the start of filming because "Ken [Branagh] wants Loki to have a lean and hungry look, like Cassius in Julius Caesar. Physically, he can't be posing as Thor".[20] Hiddleston looked at Peter O'Toole as inspiration for Loki as well explaining, "Interestingly enough, [Kenneth Branagh] said to look at Peter O'Toole in two specific films, The Lion in Winter and Lawrence of Arabia. What's interesting about ... his performance [as King Henry] is you see how damaged he is. There's a rawness [to his performance]; it's almost as if he's living with a layer of skin peeled away. He's grandiose and teary and, in a moment, by turns hilarious and then terrifying. What we wanted was that emotional volatility. It's a different acting style, it's not quite the same thing, but it's fascinating to go back and watch an actor as great as O'Toole head for those great high hills".[21] Ted Allpress portrays a young Loki.
A scientist doing research in New Mexico who encounters Thor.[22] Skarsgård stated that he was not initially familiar with the comic book version of Thor.[23] As to why he took the part, Skarsgård remarked, I "chose Thor because of [director] Kenneth Branagh. The script was nice and we got to rehearse and talk to the writers and do some collaborating in the process to make it fit us. So I had a very happy time on it. What I always try to do is immediately do something I just haven't done so I get variation in my life. I've made about 90 films and if I did the same thing over and over again I would be bored by now. I try to pick different films, I go and do those big ones and having done that I can usually afford to go and do some really small obscure films and experiment a little".[24]
King of the Frost Giants and Loki's biological father, based on the mythological being of the same name, who in myth was actually Loki's mother.[25] Feore stated it took five hours for his makeup to be applied.[26] About his character Feore remarked, "I am the King of Frost Giants. And if you've seen any of the Frost Giants, you know that I am, of course, the Napoleon of Frost Giants. We've got some massive, fabulous guys who dwarf me and come in at around eight-and-a-half feet, nine feet. But, no. Can't you tell by the commanding presence? I am the boss".[25] He said the Shakespearean training he shared with Hopkins and director Branagh helped keep production moving briskly, saying that "during the breaks, Tony, myself and Ken would be talking in Shakespearean shorthand about what the characters were doing, what we thought they may be like, and how we could focus our attention more intelligently. These were discussions that took no more than a few minutes between takes, but they allowed Ken, Tony and [me] to understand each other instantly without Ken taking an hour away to explain to the actors exactly what was going on. So that was enormously helpful."[27]
A member of the Warriors Three; a group of three Asgardian adventurers who are among Thor's closest comrades, known for both his hearty appetite and wide girth.[28] Stevenson previously worked with Kenneth Branagh in the 1998 film The Theory of Flight, and with Marvel Studios as the titular character in Punisher: War Zone. Stevenson wore a fat suit for the role, stating, "I've tried the suit on, and what they've done is kind of sex him up: he's sort of slimmer but rounder.". Stevenson said, "He's got every bit of that Falstaffian verve and vigor, and a bit of a beer gut to suggest that enormous appetite, but he's not the sort of Weeble-shaped figure he is in the comics. He's Falstaff with muscles. I've got this amazing foam-injected undersuit that flexes with me."[29]
Sam Raimi originally envisioned the idea for Thor after making Darkman (1990); he met Stan Lee and pitched the concept to 20th Century Fox, but they did not understand it.[62] Thor was abandoned until April 1997, when Marvel Studios was beginning to expand rapidly.[63] The film gained momentum after the success of X-Men (2000). The plan was for Thor to be made for television. UPN was in talks for airing it; excited by the prospect, they pushed for a script and approached Tyler Mane to play Thor.[64] In May 2000, Marvel Studios brought Artisan Entertainment to help finance it as a film, but by June 2004 the project still had yet to be patronised by a studio.[65][66][67] Sony Pictures Entertainment finally purchased the film rights, and in December 2004 David S. Goyer was in negotiations to write and direct.[68] By 2005, though there were talks between Goyer and Marvel, Goyer was no longer interested, though at this point the film was still set to be distributed through Sony Pictures.[69]
Mark Protosevich, a fan of the Thor comic book, agreed to write the script in April 2006, and the project moved to Paramount Pictures, after it acquired the rights from Sony.[70] That year the film was announced to be a Marvel Studios production.[71] In December 2007, Protosevich described his plans for it "to be like a superhero origin story, but not one about a human gaining super powers, but of a god realizing his true potential. It's the story of an Old Testament god who becomes a New Testament god".[72] In August 2007 Marvel Studios signed Matthew Vaughn to direct the film.[73] Vaughn then rewrote Protosevich's script in order to bring down the budget to $150 million, as Protosevich's first draft would have cost $300 million to produce.[6] He intended to start filming in late 2008[74] and after the success of Iron Man, Marvel Studios announced that they intended to release Thor on June 4, 2010, with Iron Man 2 being used to introduce the character of Thor.[75]
Vaughn was released when his holding deal expired in May 2008, at which point Marvel set Protosevich to work on a new draft and began searching for a new director.[77] Guillermo del Toro entered talks to direct the film. Del Toro was a fan of Jack Kirby's work on the comics, and said that he loved the character of Loki, but wished to incorporate more of the original Norse mythology into the film,[78] including a "really dingy Valhalla, [with] Vikings and mud".[79] However, del Toro ultimately turned down Thor to direct The Hobbit. By September 2008 D. J. Caruso had been discussing taking on the project, though he did not read the script.[80] Later that month, Kenneth Branagh entered into negotiations to direct,[81] and by December 2008, Branagh confirmed that he had been hired. He described it as "a human story right in the center of a big epic scenario."[82] Branagh stated that he hoped to begin filming in January 2010[83] and Marvel Studios set back the release date of the film from its scheduled July 16, 2010 date to June 17, 2011, almost a full year later.[84] They later moved the release date to May 20, 2011, to distance the film's release from that of Captain America: The First Avenger, another Marvel Studios film that was scheduled to be released on July 22, 2011.[85] In October 2008, Daniel Craig was offered the role, but ultimately turned it down, citing his commitments to the James Bond franchise.[86]
In February 2009, Samuel L. Jackson, who had briefly portrayed Nick Fury at the end of the film Iron Man, signed on to reprise the role in Thor as part of an unprecedented nine-picture deal with Marvel Studios.[59] However, in an April 2010 interview, Jackson stated that he would not be appearing in Thor. When asked why not Jackson explained, "I have no idea. I'm not in charge of making those kinds of decisions. I thought I was; they said I was in the trades, and I was like, 'Ooh! I got a job!' I called my agent he said, 'Naw, you're not in it.' I was like, 'Well shit, they need to pay me if they're gonna put my name in it.'"[87] Later in the month, Jackson revealed that he would be filming a scene for Thor to serve as "connective tissue" for The Avengers.[88] Also in February, a casting call went out looking for actors with certain physical attributes to audition for the role of Thor.[89]
In May 2009, Chris Hemsworth was in negotiations to portray the title role after a back-and-forth process in which the 25-year-old actor was refused early on, then given a second chance to read for the part. Hemsworth's brother, Liam also auditioned for the role, but was passed on by Marvel Studios head Kevin Feige.[11] The next day, Marvel announced that Tom Hiddleston, who had worked with Branagh before and had initially been considered to portray the lead role, had been cast as Loki.[19] In June 2009, Feige confirmed that both Hemsworth and Hiddleston had signed on.[90] Feige mentioned that the film would take place on both modern day Earth and Asgard but Thor's human host, Dr. Donald Blake, would not be included.[90] In July 2009, Marvel announced that Natalie Portman would portray Jane Foster.[15] Jaimie Alexander and Colm Feore were reported to have joined the cast in September, with Alexander portraying Sif and Feore's role unrevealed, though it was thought to be a villain.[49] In an interview with Swedish news site Ystads Allehanda, Stellan Skarsgård stated that he had joined the cast, though he did not specify his role.[22] By late October Anthony Hopkins had been cast as Odin in the film.[42] The following month, Marvel announced that they had cast the Warriors Three; Fandral was to be played by Stuart Townsend, Hogun was to be played by Tadanobu Asano and Volstagg was to be played by Ray Stevenson.[28] Idris Elba was announced to have joined the cast, portraying Heimdall.[30] Natalie Portman revealed that Kat Dennings would be involved in the project, portraying Darcy, a coworker of Portman's Jane Foster.[37][91]
In December 2009, Rene Russo was cast as Frigga, Thor's stepmother and Odin's wife.[40] Later that month, actors Joseph Gatt, Troy Brenna, and Joshua Cox had been cast in the film, though none of their roles were revealed.[54] In January 2010, Adriana Barraza had joined the film's cast, in a supporting capacity.[92] Only days before filming began, Stuart Townsend was replaced by Joshua Dallas as Fandral, citing "creative differences".[48] When Spider-Man 4's production stalled, Paramount and Marvel Entertainment pushed up the release of Thor by two weeks to the then vacated date of May 6, 2011.[93]
The Science & Entertainment Exchange introduced Marvel Entertainment, Kenneth Branagh, "the screenwriter, and a few people on the design and production side of things" to three physicists (Sean Carroll, Kevin Hand, and Jim Hartle), as well as physics student Kevin Hickerson, to provide a realistic science background for the Thor universe. The consultation resulted in a change in Jane Foster's profession, from nurse to particle physicist, and the terminology (Einstein-Rosen bridge) to describe the Bifrost Bridge.[94]
In October 2008, Marvel Studios signed a long-term lease agreement with Raleigh Studios to photograph their next four films—Iron Man 2, Thor, Captain America: The First Avenger and The Avengers—at Raleigh's Manhattan Beach, California facility.[95] Production Weekly reported that filming on Marvel's Thor was scheduled to begin in Los Angeles mid-January, then move to Santa Fe, New Mexico from March until late-April.[96] Principal photography began on January 11, 2010.[97] A few days after filming began, Clark Gregg signed on to reprise his role from Iron Man and Iron Man 2 as Agent Coulson.[53] In February, Paramount Pictures entered negotiations with Del Mar, California to use a 300-yard stretch of beach to film a scene for Thor involving six horses running down the terrain. Paramount said this coastline was ideal because its gradual slope of sand down to the waterline creates excellent reflective opportunities on film.[98] On March 15, 2010 production of Thor moved to Galisteo, New Mexico, where an old-fashioned Western film town was extensively modified for the shoot.[99][100]
Branagh, a fan of the comic book since childhood, commented on the challenge of bridging Asgard and the modern world: "Inspired by the comic book world both pictorially and compositionally at once, we've tried to find a way to make a virtue and a celebration of the distinction between the worlds that exist in the film but absolutely make them live in the same world. It's about finding the framing style, the color palette, finding the texture and the amount of camera movement that helps celebrate and express the differences and the distinctions in those worlds. If it succeeds, it will mark this film as different.... The combination of the primitive and the sophisticated, the ancient and the modern, I think that potentially is the exciting fusion, the exciting tension in the film".[101]
By April, the prospect for filming parts of Thor in Del Mar, California had fallen through. Paramount Pictures sent a letter informing the city that it has instead chosen an undisclosed Northern California location to film a beachfront scene for the film. The letter cited cost concerns with moving production too far away from its
In October 2010, casting calls revealed the film would be undergoing an undisclosed number of reshoots.[103] In March 2011, scenes involving Adriana Barraza were removed from the theatrical cut of the film during the editing process. Branagh sent a letter of apology explaining the reasons for the cut and desire to work with Barraza again in the future. In response Barraza stated, "It saddens me because the movie is great and because I was acting alongside some tremendous actors that I admire very much, but I understand the nature of films, and it's not the first or last time that scenes will be cut".[104] Barraza appears in only one scene in the film's theatrical cut. In that same month, Douglas Tait revealed that he performed for motion capture of the Frost Giants.[105] On his hiring, Tait said "I am 6'5" and have a lean, athletic build, and they hired guys who were 6'7" and taller, and weighed over 250 pounds (110 kg). When the film was being edited, they wanted to make them even bigger and move faster. They auditioned people again and Kenneth Branagh chose me to perform the motion capture movements of the Frost Giants".[105] In April 2011, the IMAX Corporation, Paramount Pictures and Marvel Entertainment announced that they have finalized an agreement to release the film in IMAX 3D, continuing the partnership which began on Iron Man 2.[106] Branagh stated that the 3-D process initially made him cringe but said "We came to feel that in our case 3-D could be the very good friend of story and character for a different kind of experience". Although the film was shot in 2D, Feige stated that the "special effects for the film were conceived and executed from the beginning in 3D".[107] The post-credits scene that sees Nick Fury approach Erik Selvig to ask him to study the Tesseract, was directed by The Avengers's director, Joss Whedon.[108]
BUF Compagnie served as the lead visual effects vender working on the film,[109] with Digital Domain also providing work on the film.[110] Branagh stated that BUF, who developed the effects for the race through space, were inspired by Hubble photography and other images of deep space. Branagh stated he sent paintings from classic studies by J. M. W. Turner to Digital Domain when creating Jotunheim.[111] Peter Butterworth, VFX supervisor and co-founder of Fuel VFX, said the most challenging task was interpreting what the Bifröst would look like, "You can't Google what these things look like—they are totally imagined and within the heads of the stakeholders. So to extract that and interpret it for the big screen was an interesting challenge creatively. Technically, probably creating fluid simulations that could be art-directed and used for both the Bifröst and Odin's chamber shots. Part of the difficulty with solving these is that we had to ensure they would work in stereo.[112] In the film, Odin enters what is known as the "Odinsleep" in his chamber to regenerate. Butterworth stated, "For Odin's Chamber, we developed a dome and curtain of light rays that hover over Odin's bed. This dome of light suggests harnessed power and energy that revitalizes him as he sleeps. We took a lot of reference from the natural world such as the corona of the sun and gave the sleep effect plenty of volume and space".[112]
In July 2010 Marvel Studios held a Thor panel at the 2010 San Diego Comic-Con International during which Kenneth Branagh and Chris Hemsworth, Natalie Portman, Kat Dennings, Tom Hiddleston, and Clark Gregg discussed the film and showed some clips from it.[17] A few days later, this footage was leaked on the internet.[124] The first television advertisement was broadcast during Super Bowl XLV on the Fox network in the United States. The rate for advertising during the game was approximately $3 million per 30-second spot.[125] Marvel Studios and Acura launched a joint viral marketing promotion at the 2011 Chicago Comic & Entertainment Expo.[126] Other official promotional partners included Burger King, Dr. Pepper, 7 Eleven, and Visa.[127] In May 2011 Marvel Entertainment's President of Print, Animation and Digital, Dan Buckley, and Marvel Comics Editor-In-Chief, Axel Alonso, rang the NYSE closing bell in celebration of the theatrical release of Thor.[128]
A post-credits scene in the film Iron Man 2 showed Coulson reporting the discovery of a large hammer in the desert. Rick Marshall of MTV News believed it to be the weapon Mjöllnir belonging to Thor, writing, "It continues the grand tradition of connecting the film to another property in development around the Marvel movie universe."[129] In the commentary track of Iron Man 2' home media, Iron Man 2's director, Jon Favreau, stated that "this is a scene from [the set of] Thor ".[130]
Marvel Animation announced a 26-episode animated series in November 2008, to air in late 2010 before the release of Marvel Studios' film.[131] The company released an animated direct-to-video film, Thor: Tales of Asgard, to coincide with the live-action film.[132]
A video game titled Thor: God of Thunder based on the film was developed by Sega using the voices and likenesses of actors Chris Hemsworth, Tom Hiddleston and Jaimie Alexander, and was released on May 3, 2011.[133]
In July 2011, Marvel Studios and Paramount Pictures announced the release of Thor on Blu-ray 3D, Blu-ray Disc and DVD. The discs were released on September 13, 2011 in three editions: a single-disc DVD, a 2-disc Blu-ray-DVD combo pack, and a 3-disc Blu-ray/DVD/3D combo pack. All sets come with deleted scenes and a "Road to The Avengers featurette. The 2-disc and 3-disc packs includes a digital copy, the first in a series of Marvel One-Shots, The Consultant, and 7 behind-the-scenes featurettes.[134]
Branagh said that the DVD includes at least 20 minutes of deleted scenes. Branagh stated the footage contains "things like the Asgardian parents, Odin and Frigga, played by the beautiful Rene Russo, there's some beautiful scenes in there that I think people will enjoy. And certainly Thor and Loki interacting in different ways that just fill in a little bit of a back story, that was part of our rehearsal and research."[135] In its first week of release, Thor took the number one spot on Blu-ray/DVD sales chart and topped Home Media Magazine's rental chart for the week.[136]
The film was also collected in a 10-disc box set titled "Marvel Cinematic Universe: Phase One – Avengers Assembled" which includes all of the Phase One films in the Marvel Cinematic Universe.[137] It was released on April 2, 2013.[138][139]
Thor is a 2011 American superhero film based on the Marvel Comics character of the same name, produced by Marvel Studios and distributed by Paramount Pictures.[N 1] It is the fourth film in the Marvel Cinematic Universe. The film was directed by Kenneth Branagh, written by Ashley Edward Miller & Zack Stentz and Don Payne, and stars Chris Hemsworth, Natalie Portman, Tom Hiddleston, Stellan Skarsgård, Colm Feore, Ray Stevenson, Idris Elba, Kat Dennings, Rene Russo and Anthony Hopkins. The film sees Thor, the crown prince of Asgard, banished to Earth and stripped of his powers after he reignites a dormant war. As his brother, Loki, plots to take the throne for himself, Thor must prove himself worthy and reclaim his hammer Mjolnir.
Sam Raimi first developed the concept of a film adaptation of Thor in 1991, but soon abandoned the project, leaving it in "development hell" for several years. During this time, the rights were picked up by various film studios until Marvel Studios signed Mark Protosevich to develop the project in 2006, and planned to finance it and release it through Paramount Pictures. Matthew Vaughn was originally assigned to direct the film for a tentative 2010 release. However, after Vaughn was released from his holding deal in 2008, Branagh was approached and the film's release was rescheduled into 2011. The main characters were cast in 2009, and principal photography took place in California and New Mexico from January to May 2010. The film was converted to 3D in post-production.
Thor premiered on April 17, 2011, in Sydney, Australia and was released on May 6, 2011, in the United States. The film was a financial success and received positive reviews from film critics. The DVD and Blu-ray sets were released on September 13, 2011. A sequel, Thor: The Dark World, was released on November 8, 2013. A third film, Thor: Ragnarok, is set to be released on November 3, 2017.
In 965 AD, Odin, king of Asgard, wages war against the Frost Giants of Jotunheim and their leader Laufey, to prevent them from conquering the nine realms, starting with Earth. The Asgardian warriors defeat the Frost Giants and seize the source of their power, the Casket of Ancient Winters.
In the present,[N 2] Odin's son Thor prepares to ascend to the throne of Asgard, but is interrupted when Frost Giants attempt to retrieve the Casket. Against Odin's order, Thor travels to Jotunheim to confront Laufey, accompanied by his brother Loki, childhood friend Sif and the Warriors Three: Volstagg, Fandral, and Hogun. A battle ensues until Odin intervenes to save the Asgardians, destroying the fragile truce between the two races. For Thor's arrogance, Odin strips his son of his godly power and exiles him to Earth as a mortal, accompanied by his hammer Mjolnir, now protected by an enchantment that allows only the worthy to wield it.
Thor lands in New Mexico, where astrophysicist Dr. Jane Foster, her assistant Darcy Lewis, and mentor Dr. Erik Selvig, find him. The local populace finds Mjolnir, which S.H.I.E.L.D. agent Phil Coulson soon commandeers before forcibly acquiring Jane's data about the wormhole that delivered Thor to Earth. Thor, having discovered Mjolnir's nearby location, seeks to retrieve it from the facility that S.H.I.E.L.D. quickly constructed but he finds himself unable to lift it, and is captured. With Selvig's help, he is freed and resigns himself to exile on Earth as he develops a romance with Jane.
Loki discovers that he is Laufey's biological son, adopted by Odin after the war ended. A weary Odin falls into the deep "Odinsleep" to recover his strength. Loki seizes the throne in Odin's stead and offers Laufey the chance to kill Odin and retrieve the Casket. Sif and the Warriors Three, unhappy with Loki's rule, attempt to return Thor from exile, convincing Heimdall, gatekeeper of the Bifröst—the means of traveling between worlds—to allow them passage to Earth. Aware of their plan, Loki sends the Destroyer, a seemingly indestructible automaton, to pursue them and kill Thor. The warriors find Thor, but the Destroyer attacks and defeats them, prompting Thor to offer himself instead. Struck by the Destroyer and near death, Thor's sacrifice proves him worthy to wield Mjolnir. The hammer returns to him, restoring his powers and enabling him to defeat the Destroyer. Kissing Jane goodbye and vowing to return, he and his fellow Asgardians leave to confront Loki.
In Asgard, Loki betrays and kills Laufey, revealing his true plan to use Laufey's attempt on Odin's life as an excuse to destroy Jotunheim with the Bifröst Bridge, thus proving himself worthy to his adoptive father. Thor arrives and fights Loki before destroying the Bifröst Bridge to stop Loki's plan, stranding himself in Asgard. Odin awakens and prevents the brothers from falling into the abyss created in the wake of the bridge's destruction, but Loki allows himself to fall when Odin rejects his pleas for approval. Thor makes amends with Odin, admitting he is not ready to be king; while on Earth, Jane and her team search for a way to open a portal to Asgard.
In a post-credits scene, Selvig has been taken to a S.H.I.E.L.D. facility, where Nick Fury opens a briefcase and asks him to study a mysterious cube-shaped object,[N 3] which Fury says may hold untold power. An invisible Loki prompts Selvig to agree, and he does.
The crown prince of Asgard, based on the Norse mythological deity of the same name. Director Kenneth Branagh and Marvel Studios chief Kevin Feige chose Hemsworth after a back-and-forth process in which the 27-year-old actor was initially dropped from consideration and then given a second chance to read for the part.[11] Hemsworth stated that he gained 20 pounds for the role by eating non-stop and revealed that "It wasn't until Thor that I started lifting weights, it was all pretty new to me."[12] Regarding his take on the character, Hemsworth said, "We just kept trying to humanize it all, and keep it very real. Look into all the research about the comic books that we could, but also bring it back to 'Who is this guy as a person, and what's his relationship with people in the individual scenes?'"[13] About approaching Thor's fighting style, he remarked, "First, we looked at the comic books and the posturing, the way [Thor] moves and fights, and a lot of his power seems to be drawn up through the ground. We talked about boxers, you know, Mike Tyson, very low to the ground and big open chest and big shoulder swings and very sort of brutal but graceful at the same time, and then as we shot stuff things became easier."[14] Dakota Goyo portrays a young Thor.
A scientist and Thor's love interest. Marvel Studios stated in an announcement that the character was updated from the comics' initial portrayal for the feature adaptation.[15] When asked why she took the role, Portman replied, "I just thought it sounded like a weird idea because Kenneth Branagh's directing it, so I was just like, 'Kenneth Branagh doing Thor is super-weird, I've gotta do it.'"[16] Portman stated that she really wanted to do a big effects film that emphasized character, and getting to do it with Branagh was a new way of approaching it, relative to Star Wars.[17] Regarding her preparation for the role Portman remarked, "I signed on to do it before there was a script. And Ken, who's amazing, who is so incredible, was like, 'You can really help create this character'. I got to read all of these biographies of female scientists like Rosalind Franklin who actually discovered the DNA double helix but didn't get the credit for it. The struggles they had and the way that they thought – I was like, 'What a great opportunity, in a very big movie that is going to be seen by a lot of people, to have a woman as a scientist'. She's a very serious scientist. Because in the comic she's a nurse and now they made her an astrophysicist. Really, I know it sounds silly, but it is those little things that makes girls think it's possible. It doesn't give them a [role] model of 'Oh, I just have to dress cute in movies'".[18]
Thor's adoptive brother and nemesis based on the deity of the same name. Hiddleston was chosen after previously working with Branagh on Ivanov and Wallander.[19] Initially, Hiddleston auditioned to play Thor but Branagh decided his talent would be better harnessed playing Loki. Hiddleston stated that, "Loki's like a comic book version of Edmund in King Lear, but nastier." Hiddleston stated that he had to keep a strict diet before the start of filming because "Ken [Branagh] wants Loki to have a lean and hungry look, like Cassius in Julius Caesar. Physically, he can't be posing as Thor".[20] Hiddleston looked at Peter O'Toole as inspiration for Loki as well explaining, "Interestingly enough, [Kenneth Branagh] said to look at Peter O'Toole in two specific films, The Lion in Winter and Lawrence of Arabia. What's interesting about ... his performance [as King Henry] is you see how damaged he is. There's a rawness [to his performance]; it's almost as if he's living with a layer of skin peeled away. He's grandiose and teary and, in a moment, by turns hilarious and then terrifying. What we wanted was that emotional volatility. It's a different acting style, it's not quite the same thing, but it's fascinating to go back and watch an actor as great as O'Toole head for those great high hills".[21] Ted Allpress portrays a young Loki.
A scientist doing research in New Mexico who encounters Thor.[22] Skarsgård stated that he was not initially familiar with the comic book version of Thor.[23] As to why he took the part, Skarsgård remarked, I "chose Thor because of [director] Kenneth Branagh. The script was nice and we got to rehearse and talk to the writers and do some collaborating in the process to make it fit us. So I had a very happy time on it. What I always try to do is immediately do something I just haven't done so I get variation in my life. I've made about 90 films and if I did the same thing over and over again I would be bored by now. I try to pick different films, I go and do those big ones and having done that I can usually afford to go and do some really small obscure films and experiment a little".[24]
King of the Frost Giants and Loki's biological father, based on the mythological being of the same name, who in myth was actually Loki's mother.[25] Feore stated it took five hours for his makeup to be applied.[26] About his character Feore remarked, "I am the King of Frost Giants. And if you've seen any of the Frost Giants, you know that I am, of course, the Napoleon of Frost Giants. We've got some massive, fabulous guys who dwarf me and come in at around eight-and-a-half feet, nine feet. But, no. Can't you tell by the commanding presence? I am the boss".[25] He said the Shakespearean training he shared with Hopkins and director Branagh helped keep production moving briskly, saying that "during the breaks, Tony, myself and Ken would be talking in Shakespearean shorthand about what the characters were doing, what we thought they may be like, and how we could focus our attention more intelligently. These were discussions that took no more than a few minutes between takes, but they allowed Ken, Tony and [me] to understand each other instantly without Ken taking an hour away to explain to the actors exactly what was going on. So that was enormously helpful."[27]
A member of the Warriors Three; a group of three Asgardian adventurers who are among Thor's closest comrades, known for both his hearty appetite and wide girth.[28] Stevenson previously worked with Kenneth Branagh in the 1998 film The Theory of Flight, and with Marvel Studios as the titular character in Punisher: War Zone. Stevenson wore a fat suit for the role, stating, "I've tried the suit on, and what they've done is kind of sex him up: he's sort of slimmer but rounder.". Stevenson said, "He's got every bit of that Falstaffian verve and vigor, and a bit of a beer gut to suggest that enormous appetite, but he's not the sort of Weeble-shaped figure he is in the comics. He's Falstaff with muscles. I've got this amazing foam-injected undersuit that flexes with me."[29]
Sam Raimi originally envisioned the idea for Thor after making Darkman (1990); he met Stan Lee and pitched the concept to 20th Century Fox, but they did not understand it.[62] Thor was abandoned until April 1997, when Marvel Studios was beginning to expand rapidly.[63] The film gained momentum after the success of X-Men (2000). The plan was for Thor to be made for television. UPN was in talks for airing it; excited by the prospect, they pushed for a script and approached Tyler Mane to play Thor.[64] In May 2000, Marvel Studios brought Artisan Entertainment to help finance it as a film, but by June 2004 the project still had yet to be patronised by a studio.[65][66][67] Sony Pictures Entertainment finally purchased the film rights, and in December 2004 David S. Goyer was in negotiations to write and direct.[68] By 2005, though there were talks between Goyer and Marvel, Goyer was no longer interested, though at this point the film was still set to be distributed through Sony Pictures.[69]
Mark Protosevich, a fan of the Thor comic book, agreed to write the script in April 2006, and the project moved to Paramount Pictures, after it acquired the rights from Sony.[70] That year the film was announced to be a Marvel Studios production.[71] In December 2007, Protosevich described his plans for it "to be like a superhero origin story, but not one about a human gaining super powers, but of a god realizing his true potential. It's the story of an Old Testament god who becomes a New Testament god".[72] In August 2007 Marvel Studios signed Matthew Vaughn to direct the film.[73] Vaughn then rewrote Protosevich's script in order to bring down the budget to $150 million, as Protosevich's first draft would have cost $300 million to produce.[6] He intended to start filming in late 2008[74] and after the success of Iron Man, Marvel Studios announced that they intended to release Thor on June 4, 2010, with Iron Man 2 being used to introduce the character of Thor.[75]
Vaughn was released when his holding deal expired in May 2008, at which point Marvel set Protosevich to work on a new draft and began searching for a new director.[77] Guillermo del Toro entered talks to direct the film. Del Toro was a fan of Jack Kirby's work on the comics, and said that he loved the character of Loki, but wished to incorporate more of the original Norse mythology into the film,[78] including a "really dingy Valhalla, [with] Vikings and mud".[79] However, del Toro ultimately turned down Thor to direct The Hobbit. By September 2008 D. J. Caruso had been discussing taking on the project, though he did not read the script.[80] Later that month, Kenneth Branagh entered into negotiations to direct,[81] and by December 2008, Branagh confirmed that he had been hired. He described it as "a human story right in the center of a big epic scenario."[82] Branagh stated that he hoped to begin filming in January 2010[83] and Marvel Studios set back the release date of the film from its scheduled July 16, 2010 date to June 17, 2011, almost a full year later.[84] They later moved the release date to May 20, 2011, to distance the film's release from that of Captain America: The First Avenger, another Marvel Studios film that was scheduled to be released on July 22, 2011.[85] In October 2008, Daniel Craig was offered the role, but ultimately turned it down, citing his commitments to the James Bond franchise.[86]
In February 2009, Samuel L. Jackson, who had briefly portrayed Nick Fury at the end of the film Iron Man, signed on to reprise the role in Thor as part of an unprecedented nine-picture deal with Marvel Studios.[59] However, in an April 2010 interview, Jackson stated that he would not be appearing in Thor. When asked why not Jackson explained, "I have no idea. I'm not in charge of making those kinds of decisions. I thought I was; they said I was in the trades, and I was like, 'Ooh! I got a job!' I called my agent he said, 'Naw, you're not in it.' I was like, 'Well shit, they need to pay me if they're gonna put my name in it.'"[87] Later in the month, Jackson revealed that he would be filming a scene for Thor to serve as "connective tissue" for The Avengers.[88] Also in February, a casting call went out looking for actors with certain physical attributes to audition for the role of Thor.[89]
In May 2009, Chris Hemsworth was in negotiations to portray the title role after a back-and-forth process in which the 25-year-old actor was refused early on, then given a second chance to read for the part. Hemsworth's brother, Liam also auditioned for the role, but was passed on by Marvel Studios head Kevin Feige.[11] The next day, Marvel announced that Tom Hiddleston, who had worked with Branagh before and had initially been considered to portray the lead role, had been cast as Loki.[19] In June 2009, Feige confirmed that both Hemsworth and Hiddleston had signed on.[90] Feige mentioned that the film would take place on both modern day Earth and Asgard but Thor's human host, Dr. Donald Blake, would not be included.[90] In July 2009, Marvel announced that Natalie Portman would portray Jane Foster.[15] Jaimie Alexander and Colm Feore were reported to have joined the cast in September, with Alexander portraying Sif and Feore's role unrevealed, though it was thought to be a villain.[49] In an interview with Swedish news site Ystads Allehanda, Stellan Skarsgård stated that he had joined the cast, though he did not specify his role.[22] By late October Anthony Hopkins had been cast as Odin in the film.[42] The following month, Marvel announced that they had cast the Warriors Three; Fandral was to be played by Stuart Townsend, Hogun was to be played by Tadanobu Asano and Volstagg was to be played by Ray Stevenson.[28] Idris Elba was announced to have joined the cast, portraying Heimdall.[30] Natalie Portman revealed that Kat Dennings would be involved in the project, portraying Darcy, a coworker of Portman's Jane Foster.[37][91]
In December 2009, Rene Russo was cast as Frigga, Thor's stepmother and Odin's wife.[40] Later that month, actors Joseph Gatt, Troy Brenna, and Joshua Cox had been cast in the film, though none of their roles were revealed.[54] In January 2010, Adriana Barraza had joined the film's cast, in a supporting capacity.[92] Only days before filming began, Stuart Townsend was replaced by Joshua Dallas as Fandral, citing "creative differences".[48] When Spider-Man 4's production stalled, Paramount and Marvel Entertainment pushed up the release of Thor by two weeks to the then vacated date of May 6, 2011.[93]
The Science & Entertainment Exchange introduced Marvel Entertainment, Kenneth Branagh, "the screenwriter, and a few people on the design and production side of things" to three physicists (Sean Carroll, Kevin Hand, and Jim Hartle), as well as physics student Kevin Hickerson, to provide a realistic science background for the Thor universe. The consultation resulted in a change in Jane Foster's profession, from nurse to particle physicist, and the terminology (Einstein-Rosen bridge) to describe the Bifrost Bridge.[94]
In October 2008, Marvel Studios signed a long-term lease agreement with Raleigh Studios to photograph their next four films—Iron Man 2, Thor, Captain America: The First Avenger and The Avengers—at Raleigh's Manhattan Beach, California facility.[95] Production Weekly reported that filming on Marvel's Thor was scheduled to begin in Los Angeles mid-January, then move to Santa Fe, New Mexico from March until late-April.[96] Principal photography began on January 11, 2010.[97] A few days after filming began, Clark Gregg signed on to reprise his role from Iron Man and Iron Man 2 as Agent Coulson.[53] In February, Paramount Pictures entered negotiations with Del Mar, California to use a 300-yard stretch of beach to film a scene for Thor involving six horses running down the terrain. Paramount said this coastline was ideal because its gradual slope of sand down to the waterline creates excellent reflective opportunities on film.[98] On March 15, 2010 production of Thor moved to Galisteo, New Mexico, where an old-fashioned Western film town was extensively modified for the shoot.[99][100]
Branagh, a fan of the comic book since childhood, commented on the challenge of bridging Asgard and the modern world: "Inspired by the comic book world both pictorially and compositionally at once, we've tried to find a way to make a virtue and a celebration of the distinction between the worlds that exist in the film but absolutely make them live in the same world. It's about finding the framing style, the color palette, finding the texture and the amount of camera movement that helps celebrate and express the differences and the distinctions in those worlds. If it succeeds, it will mark this film as different.... The combination of the primitive and the sophisticated, the ancient and the modern, I think that potentially is the exciting fusion, the exciting tension in the film".[101]
By April, the prospect for filming parts of Thor in Del Mar, California had fallen through. Paramount Pictures sent a letter informing the city that it has instead chosen an undisclosed Northern California location to film a beachfront scene for the film. The letter cited cost concerns with moving production too far away from its
In October 2010, casting calls revealed the film would be undergoing an undisclosed number of reshoots.[103] In March 2011, scenes involving Adriana Barraza were removed from the theatrical cut of the film during the editing process. Branagh sent a letter of apology explaining the reasons for the cut and desire to work with Barraza again in the future. In response Barraza stated, "It saddens me because the movie is great and because I was acting alongside some tremendous actors that I admire very much, but I understand the nature of films, and it's not the first or last time that scenes will be cut".[104] Barraza appears in only one scene in the film's theatrical cut. In that same month, Douglas Tait revealed that he performed for motion capture of the Frost Giants.[105] On his hiring, Tait said "I am 6'5" and have a lean, athletic build, and they hired guys who were 6'7" and taller, and weighed over 250 pounds (110 kg). When the film was being edited, they wanted to make them even bigger and move faster. They auditioned people again and Kenneth Branagh chose me to perform the motion capture movements of the Frost Giants".[105] In April 2011, the IMAX Corporation, Paramount Pictures and Marvel Entertainment announced that they have finalized an agreement to release the film in IMAX 3D, continuing the partnership which began on Iron Man 2.[106] Branagh stated that the 3-D process initially made him cringe but said "We came to feel that in our case 3-D could be the very good friend of story and character for a different kind of experience". Although the film was shot in 2D, Feige stated that the "special effects for the film were conceived and executed from the beginning in 3D".[107] The post-credits scene that sees Nick Fury approach Erik Selvig to ask him to study the Tesseract, was directed by The Avengers's director, Joss Whedon.[108]
BUF Compagnie served as the lead visual effects vender working on the film,[109] with Digital Domain also providing work on the film.[110] Branagh stated that BUF, who developed the effects for the race through space, were inspired by Hubble photography and other images of deep space. Branagh stated he sent paintings from classic studies by J. M. W. Turner to Digital Domain when creating Jotunheim.[111] Peter Butterworth, VFX supervisor and co-founder of Fuel VFX, said the most challenging task was interpreting what the Bifröst would look like, "You can't Google what these things look like—they are totally imagined and within the heads of the stakeholders. So to extract that and interpret it for the big screen was an interesting challenge creatively. Technically, probably creating fluid simulations that could be art-directed and used for both the Bifröst and Odin's chamber shots. Part of the difficulty with solving these is that we had to ensure they would work in stereo.[112] In the film, Odin enters what is known as the "Odinsleep" in his chamber to regenerate. Butterworth stated, "For Odin's Chamber, we developed a dome and curtain of light rays that hover over Odin's bed. This dome of light suggests harnessed power and energy that revitalizes him as he sleeps. We took a lot of reference from the natural world such as the corona of the sun and gave the sleep effect plenty of volume and space".[112]
In July 2010 Marvel Studios held a Thor panel at the 2010 San Diego Comic-Con International during which Kenneth Branagh and Chris Hemsworth, Natalie Portman, Kat Dennings, Tom Hiddleston, and Clark Gregg discussed the film and showed some clips from it.[17] A few days later, this footage was leaked on the internet.[124] The first television advertisement was broadcast during Super Bowl XLV on the Fox network in the United States. The rate for advertising during the game was approximately $3 million per 30-second spot.[125] Marvel Studios and Acura launched a joint viral marketing promotion at the 2011 Chicago Comic & Entertainment Expo.[126] Other official promotional partners included Burger King, Dr. Pepper, 7 Eleven, and Visa.[127] In May 2011 Marvel Entertainment's President of Print, Animation and Digital, Dan Buckley, and Marvel Comics Editor-In-Chief, Axel Alonso, rang the NYSE closing bell in celebration of the theatrical release of Thor.[128]
A post-credits scene in the film Iron Man 2 showed Coulson reporting the discovery of a large hammer in the desert. Rick Marshall of MTV News believed it to be the weapon Mjöllnir belonging to Thor, writing, "It continues the grand tradition of connecting the film to another property in development around the Marvel movie universe."[129] In the commentary track of Iron Man 2' home media, Iron Man 2's director, Jon Favreau, stated that "this is a scene from [the set of] Thor ".[130]
Marvel Animation announced a 26-episode animated series in November 2008, to air in late 2010 before the release of Marvel Studios' film.[131] The company released an animated direct-to-video film, Thor: Tales of Asgard, to coincide with the live-action film.[132]
A video game titled Thor: God of Thunder based on the film was developed by Sega using the voices and likenesses of actors Chris Hemsworth, Tom Hiddleston and Jaimie Alexander, and was released on May 3, 2011.[133]
In July 2011, Marvel Studios and Paramount Pictures announced the release of Thor on Blu-ray 3D, Blu-ray Disc and DVD. The discs were released on September 13, 2011 in three editions: a single-disc DVD, a 2-disc Blu-ray-DVD combo pack, and a 3-disc Blu-ray/DVD/3D combo pack. All sets come with deleted scenes and a "Road to The Avengers featurette. The 2-disc and 3-disc packs includes a digital copy, the first in a series of Marvel One-Shots, The Consultant, and 7 behind-the-scenes featurettes.[134]
Branagh said that the DVD includes at least 20 minutes of deleted scenes. Branagh stated the footage contains "things like the Asgardian parents, Odin and Frigga, played by the beautiful Rene Russo, there's some beautiful scenes in there that I think people will enjoy. And certainly Thor and Loki interacting in different ways that just fill in a little bit of a back story, that was part of our rehearsal and research."[135] In its first week of release, Thor took the number one spot on Blu-ray/DVD sales chart and topped Home Media Magazine's rental chart for the week.[136]
The film was also collected in a 10-disc box set titled "Marvel Cinematic Universe: Phase One – Avengers Assembled" which includes all of the Phase One films in the Marvel Cinematic Universe.[137] It was released on April 2, 2013.[138][139]
BASh Scripting
------------------------------------------------------
Solving Instructions for outlab assignment
------------------------------------------------------
Strictly follow the instructions given below:
1. Solution for each assignment is to be typed into the .sh file already kept inside the
corresponding folder.
2. Remember, you need to change the permission of the .sh file before executing it:
​ chmod u+x ​ <scriptfile> or chmod 777 <scriptfile>
3. Do not change the structure and the names.. The automatic checker will give you a
“not­submitted” grade otherwise, if it does not find the names.
4. Remember to follow the exact output formats specified. Extra characters will lead to incorrect evaluation by automatic checker.
5. Inside the script if you use any temporary file, write command to remove it after the
operation within that script only.
-----------------------------------------------------------
Submission Guidelines for outlab assignment
-----------------------------------------------------------
1. Create a file readme.txt in bash_inlab directory, which contains contribution of each team member and references.
2. Rename the directory bash_inlab to <team_name>.
3. Compress the directory to <team_name>.tar.gz
4. Submit one assignment per team.
*******************************************************************************************************
=======================
Out-Lab Problem Statement:
=======================
----------------------------------------
Problem 1:
----------------------------------------
You are required to modify your ‘.bashrc’ file (which is a hidden file in your home folder) and create an alias inside it. The alias should be able to get the space usage of all the files and folders and display it on your screen.
The output of your script should display a list of files and folders in the current directory on the terminal (to be ‘precise’).
You should take a screenshot of the output, when your script is executed in the “home” folder and paste the ‘jpg’ or ‘png’ in the folder ‘script1’. You are also required to paste the ‘.bashrc’ file in the folder script1/.
>>script1/ls -lh
Output:
>><screenshot_image_name>.<jpg_or_png>
>>.bashrc
We will check this manually and grade accordingly.
----------------------------------------
Problem 2:
----------------------------------------
You are ‘yet-again’ required to change your ‘.bashrc’ file to display a welcome message every time you log on to your linux (e.g. ubuntu) terminal. The welcome message must be an ASCII art which can be created using the web-service:
http://patorjk.com/software/taag/#p=display&f=Graffiti&t=sample
The link above allows you to type any text and create ASCII art of the text using special characters on your keyboard. You can add such text to your ‘.bashrc’ file and try logging in again to the terminal. When your welcome message is displayed, please take a screenshot similar to the last statement and paste in the folder script2/. You must also paste your modified ‘.bashrc’ file in the folder script2/.
>>script1/ls -lh
Output:
>><screenshot_image_name>.<jpg_or_png>
>>.bashrc
----------------------------------------
Problem 3:
----------------------------------------
Write a bash script to take a path as an input argument. Your bash script should be able to count the no. of lines in all the files present in the path (“directory”) provided. The output of your script should only be the count of the number of lines present (you should not count blank lines in the above files).
From here onwards your assignments shall be graded automatically using scripts, so please ensure the output is simply a number and nothing else (please ensure you do not count blank lines).
E.g.
Path is test/
>>./script3.sh test/
>>180
----------------------------------------
Problem 4:
----------------------------------------
A class of students were given a form to fill regarding team/group formation for evaluating their grades. The TAs of the class did not take into account that they will have to write a bash script to group the teams and a simple Google form / excel input doesn’t really cut it for them. The TAs are now in a soup and need your help desperately. Write a bash script to take as input the ‘csv (comma-separated value) file’ provided to you in the folder structure. The script should be able to group the students as shown below:
Input file:
team1,student1,rollno_student1,student2,rollno_student2,student3,rollno_student3
team2,student1,rollno_student1,student2,rollno_student2,student3,rollno_student3
team3,student1,rollno_student1,student2,rollno_student2,student3,rollno_student3
team4,student1,rollno_student1,student2,rollno_student2,student3,rollno_student3
Output:
team1,student1,rollno_student1
team1,student2,rollno_student2
team1,student3,rollno_student3
team2,student1,rollno_student1
.
.
.
.
(Output must also be sorted on the column number 1 (team_name)
E.g.:
>>./script4.sh <inputfilename>
The output of your script must be stored in the file named ‘output’ inside your folder script4/
This problem statement shall be graded automatically using scripts, so please ensure your output is contained in the file name ‘output’ and it is sorted based on team names (column 1).
HINT: you should be able to use the commands sort/cut for doing this assignment problem.
P.S.:
This is a work of fiction. TAs, Students, faculty, class, lab and any other incidents are either the products of the author's imagination or used in a fictitious manner. Any resemblance to actual persons in the input data, living or dead, or actual events is purely coincidental.
----------------------------------------
Problem 5:
----------------------------------------
You are a nerd-to-the-core and want to know the current weather by typing a command from your terminal. You trust “Accuweather” service to provide you with details but the catch is that it is a web/mobile device based service. You very well know that using the command ‘wget’ and adding a few flags/options will get you the html data of the webpage on terminal.
The challenge here is to modify your “.bashrc” file and create an alias which would enable you to simply fire a command on your terminal to show you the details of the current location (which in your case is Mumbai) weather as shown by the Accuweather service on the webpage.
As an output to this program we would like to see a screenshot similar to the problems 1 and 2 above placed in your folder named script5/ along with the .bashrc file.
Hint: The URL of the accuweather page where it shows the weather details is something you should be looking at and a few simple ‘grep’ commands should be able to get you something like this:
acm_RecentLocationsCarousel.push({name:"Mumbai Central, India", daypart:'night', href:'/en/in/mumbai-central/3352466/weather-forecast/3352466', icon:'i-35-l', bg:'cl', temp:'29', realfeel:'36', text:"Partly cloudy"});
Which is an acceptable solution to us. If you can/want to modify/improve/filter further, you are welcome to do so. There would be no extra credit for further filtration. The above line if displayed on your screenshot should be enough, but the use of ‘.bashrc’ to create an alias is necessary.
----------------------------------------
Problem 6:
----------------------------------------
You aim to be a famous English rapper in life and as over-ambitious as it may seem, you have volunteered to rap “The Real Slim Shady” by ‘Eminem’ on stage during “Surbahaar”. You are surprised(read: shocked) to suddenly know that your parents/faculty/Dean(SA) will also attend the show. You can make do with your “Dhinchak Pooja” like voice but you definitely cannot sing the actual lyrics of the song in front of the current audience.
One of your friends (read: a TA of this class) was gracious enough to send you a list of cuss words used in the song.
Write a bash script which takes two input arguments as file-names. You bash script should be able to replace the cuss word with “bleep” in the lyrics file provided. The output of your bash script should be in a file named ‘output’. For the people who need us to be precise, let the first input argument be your ‘lyrics’ file you need to clean, and the second input argument be ‘cuss-word list’ file (one cuss word per line).
P.S.: Later this will help you take a printout of the ‘output’ file and give your “dhinchak” performance.
P.P.S: This problem statement comes with a disclaimer, “People who are easily offended by cuss words/slang usage/offensive rap should not read the lyric file provided”. Simply replace the words, and submit the script and the output file in the folder.
Extra-credit assignments (for enthu junta):
We know this already seems hectic but in case you have some time left, and are enthu to learn more, you can do
1. Bash modification: You know BASh since you are using it now, but do you know “ZSH”, “Oh-my-ZSH” and other bash themes. You could look here, if a fancy bash (with more features and much better looking) interests you:
https://github.com/robbyrussell/oh-my-zsh
1. Googler: Do you know that you can Google stuff over terminal itself (for the ultra-geeks) ? Try this:
https://github.com/jarun/googler
If you can install these successfully and send screenshots in the folder named extra/, you shall be rewarded with extra-credit points which can be ‘justifiably’ used against loss of point/marks in the latter assignments. The total marks for this assignment shall remain the same for all of you, these extra-credits may only be used if your total is falling below a certain level.
three idiots
alias in q1 : use command 'size_list'
alias in q5 : use command 'weather'
1 : 160050069
2 : 160050091
5 : 160050100
3 ,4 ,6 ,extras : All three of us collaborated
1) googler : screenshot of google search for "game of thrones"
2) zsh : "weather" alias added to .zshrc and screenshot illustrates the usage of weather in "zsh"
3) ohmyzsh : screenshot showing installation success.
references : ryan tutorials , google (basically stack overflow)
github for googler and oh-my-zsh.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for example
alias size_list='
for value in "*"
do
du -s $value
done
echo Total - $(du -s)'
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
echo '
██╗ ██╗███████╗██╗ ██╗ ██████╗ ███████╗██████╗ ██╗███████╗███╗ ██╗██████╗ ███████╗
██║ ██║██╔════╝██║ ██║ ██╔═══██╗ ██╔════╝██╔══██╗██║██╔════╝████╗ ██║██╔══██╗██╔════╝
███████║█████╗ ██║ ██║ ██║ ██║ █████╗ ██████╔╝██║█████╗ ██╔██╗ ██║██║ ██║███████╗
██╔══██║██╔══╝ ██║ ██║ ██║ ██║ ██╔══╝ ██╔══██╗██║██╔══╝ ██║╚██╗██║██║ ██║╚════██║
██║ ██║███████╗███████╗███████╗╚██████╔╝ ██║ ██║ ██║██║███████╗██║ ╚████║██████╔╝███████║
╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝╚═╝ ╚═══╝╚═════╝ ╚══════╝
'
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
#!/bin/bash
result=0
funct() {
for afile in $1*
do
n=$(echo $(ls -lR $1 | grep ^d | wc -l))
if [ -d $afile ]
then
funct $afile/
else
nooflines=0
wcout=$(wc -l $afile)
n=$(echo $wcout | cut -d' ' -f 1)
j=1
while [ $j -le $n ]
do
line=$(cat $afile | cut -d'
' -f $j)
wordcount=$(echo $line | wc -w)
if [ $wordcount -gt 0 ]
then
((nooflines++))
fi
((j++))
done
let " result = $result + $nooflines "
fi
done
}
funct $1
echo $result
#sed'/^\s*$/d' | wc -l
\ No newline at end of file
Tech-knights,Neelesh verma,160050062,Vamshi sevakula,160050079,Gunti Dheeraj kumar,160050081
Team in the North,Ishan Tarunesh,160050054,Priyanshu Meel,160050052,Shivam Patel,160050003
DELTA,S.Sai Kalyan,160050095,V.Niranjan,160050099,N.Suraj,160050087
Shinigami,Suraj soni,160050092,Jagadeep sai,160050104,Suseendran Baskaran,160050104
Izanagi,Sai Tarun Inaganti,160050103,Nikhil Samrat Gunda,160050088,Jeevithiesh Duggani,160050101
Innovative pals,Aryan,160050053,Sushant Tarun,160050055,Tanmaya Shekhawat,160050051
The Bro-Code,Sushil Khyalia,160050035,Kartik Khandelwal,160070025,Syamantak Kumar,16D070025
3 Idiots,Sahil Shah,160050005,Preey Shah,160050008,Aman Bansal,160050028
Team Ragnarok,Rahul Chunduru,160050072,Pavan Bhargav,160050076,Sai Ganesh,160050078
Team eNRGy,Gurparkash Singh,160050112,Rajat Rathi,160050015,Nikhil Tummidi,160050096
Three idiots,Rama Mahidhar Reddy Kancharla,160050091,Shantanu Kumar,160050069,Sai Praneeeth Reddy Sunkesula,160050100
TheCodeFathers,Shreyash Meena,160050058,Sharvik Mittal,160050059,Ankit Goyal,160050046
The Brogrammers,Sathvik Reddy Kollu,160050077,Saiteja Talluri,160050098,Saiteja Nangunoori,160050089
Code && Seek,Yaswanth Kumar Orru,160050066,Lakshmi Narayana Chappidi,160050080,Manoj Middepogu,160050075
Code Budgies,Mude Chaitanya Naik,160050102,Sunchu Rohit,160050097,Abhishek Akkabathula,160050074
Epsilon-Delta,Nitish Joshi,160070017,Adwait Godbole,160070021,Rishabh Raj,160050029
CodeMAFIA,Kunal Goyal,160050026,Aman Jain,160050034,Eashan Gupta,160050045
Ransomware,Anshu Ahirwar,150050077,Deepesh Meena,150050041,Ashish Chandra,05D05016
Leo,Mayank Singhal,160050039,Yash Gupta,160050037,Piyush Onkar,160050012
zen_coders,Utkarsh Gupta,160050032,R Sudarsanan,160050067,Shubham Gupta,160050061
codekars,Ashish Mittal,160050022,Rupesh,160050042,Debanjan Mondal,160050071
Eclipse,Satti Vamsi Krishna Reddy,160050064,Vighnesh Reddy Konda,160050090,Naman Jain,160050025
Contour,Saurav Kumar,160050057,Saunack Kumar,160050056,Yash Shah,160050002
Code-Catalyst,Sai Charith,160050083,Sanchit Jain,160050043,Attarv,160050004
webpandas,Shourya Pandey,160050013,Sriram Balasubramaniam,160070012,Nilay Pande,160070013
Aurora,Shubham Anand,160050060,Aman Jain,160050019,Ashutosh Kumar Verma,160050063
Hackslash,Tanmayee Kondeti,160050093,Gayatri Konkatwar,160050007,Suraj Bishnoi,160050023
Falcon,Aditya Jadhav,160050010,Akshay Patiday,160050050,Dhruv Jaglan,160050106
Hakunamatata,Rajat majoka,160050031,Prateek,160050110,Simranpreet singh,160050111
Wizards,Ritesh Goenka,160050047,Gaurav Didwania,160050020,Aditya Kumar Mahto,160050094
Codex,Vikrant Garg,160050033,Rohit Choudhary,160050030,Sahil Saiyad,160050021
Red Coders,Amey Patil,160050006,Vinod Shekokar,160050016,Abhro Bhuniya,160050017
HuffleClaw,Harsh Siloiya,160050011,Onkar Piyush Pradeep,160050012,Anirudh Arputham ,160010056
CodeGeeks,Rao Pranav Vasudeva,160100021,Deep Karkhanis,160100024,Sriram Yenamandra,16D070017
Marauders,Maitrey Gramopadhye,160050049,Bhavesh Dhingra,160050108,Sourabh Tote,160050009
sudoofus,Chinmay Awale,160050014,Harshwardhan Mourya,160050048,Rohan Garg,160050018
Tech Knights,Mayanka Medhe,160050027,Chanchal Godara,160050038,Sumit Chaturvedi,160110098
SYNTAX,E.Praneeth,160050073,Bhaviripudi Avinash,160050082,V.Varun Kumar,160050084
Void Walkers,Meet Kathiriya,160050001,Shreyas Pimpalgaonkar,160050024,Phuntsog Wangchuk,160050109
#!/bin/bash
inp=$(cat $1 | sort)
dirpath=$(dirname ${1})
num=$(wc -l $1)
i=0
while [ $i -le $(echo $num | cut -d' ' -f 1) ]
do
var=$(cat $1 | sort | cut -d'
' -f $(expr 1 + $i))
wordcount=$(echo $var | wc -w)
if [ $(echo $wordcount | cut -d' ' -f 1) -gt 0 ]
then
team=$(echo $var | cut -d',' -f 1)
st1=$(echo $var | cut -d',' -f 2)
st2=$(echo $var | cut -d',' -f 4)
st3=$(echo $var | cut -d',' -f 6)
roll1=$(echo $var | cut -d',' -f 3)
roll2=$(echo $var | cut -d',' -f 5)
roll3=$(echo $var | cut -d',' -f 7)
echo $team,$st1,$roll1 >> $dirpath/output
echo $team,$st2,$roll2 >> $dirpath/output
echo $team,$st3,$roll3 >> $dirpath/output
fi
((i++))
done
\ No newline at end of file
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for example
alias weather="
wget -q -O- "https://www.accuweather.com/en/in/mumbai/204842/weather-forecast/204842" | awk -F\' '/acm_RecentLocationsCarousel\.push/' | grep -m 1 ';'
"
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
May I have your attention please?
May I have your attention please?
Will the real Slim Shady please stand up?
I repeat will the real Slim Shady please stand up?
We're going to have a problem here
Y'all act like you never seen a white person before
Jaws all on the floor like Pam and Tommy just burst in the door
Started whoopin' her ass worse than before, they first get divorced
Throwing her over furniture
It's the return of the "Oh wait, no way, your kidding,
He didn't just say what I think he did, did he?"
And Dr Dre said
Nothing you idiots Dr Dre's dead, he's locked in my basement (ha ha)
Feminist women love Eminem, chicka chicka chicka Slim Shady I'm sick of him
Look at him, walking around grabbing his you know what
Flippin' the you know who "yeah, but he's so cute though"
Yea I probably got a couple of screws up in my head loose
But no worse than what's going on in your parent's bedrooms
Sometimes I want to get on TV and just let loose, but can't,
But it's cool for Tom Green to hump a dead moose
My bum is on your lips, my bum is on your lips
And if I'm lucky you might just give it a little kiss
And that's the message that we deliver to little kids
And expect them not to know what a women's clitoris is.
Of course they gonna know what intercourse is, by the time they hit 4th grade,
They got the discovery channel don't they?
We ain't nothing but mammals,
Well some of us cannibals, who cut other people open like cantaloupes.
But if we can hump dead animals and antelopes
Then there's no reason that a man and another man can't elope
But if you feel like I feel I got the antidote.
Women wave your pantyhose, sing the chorus and it goes
I'm Slim Shady, yes I'm the real Shady
All you other Slim Shadys are just imitating
So won't the real Slim Shady, please stand up,
Please stand up,
Please stand up
'Cause I'm Slim Shady, yes I'm the real Shady
All you other Slim Shadys are just imitating
So won't the real Slim Shady, please stand up,
Please stand up,
Please stand up
Will Smith don't gotta cuss in his raps to sell records
Well I do, so fuck him and fuck you too.
You think I give a damn about a Grammy?
Half of you critics can't even stomach me, let alone stand me.
"But Slim what if you win wouldn't it be weird?"
Why? So you guys can just lie to get me here?
So you can sit me here next to Britney Spears.
Shit, Christina Aguilera better switch me chairs
So I can sit next to Carson Daly and Fred Durst
And hear 'em argue over who she gave head to first.
Little bitch put me on blast on M-T-V
"Yeah he's cute but I think he's married to Kim, he he"
I should download her audio on mp3
And show the whole world how you gave Eminem V.D.
I'm sick of you little girl and boy groups all you do is annoy me
So I've been sent here to destroy you
And there's a million of us just like me
Who cuss like me, who just don't give a fuck like me, who dress like me
Walk, talk and act like me, it just might be the next best thing,
But not quite me
'Cause I'm Slim Shady, yes I'm the real Shady
All you other Slim Shadys are just imitating
So won't the real Slim Shady, please stand up,
Please stand up,
Please stand up
'Cause I'm Slim Shady, yes I'm the real Shady
All you other Slim Shadys are just imitating
So won't the real Slim Shady, please stand up,
Please stand up,
Please stand up
I'm like a head trip to listen to
'Cause I'm only giving you, things you joke about with your friends
Inside your living room
The only difference is I got the balls to say it in front of y'all
And I don't gotta be false or sugar coat it at all
I just get on the mic and spit it, and whether you like to admit it (rip)
I just shit it better than 90 percent of you rappers out there
Then you wonder how can kids eat up these albums like Valiums, it's funny
'Cause at the rate I'm going when I'm thirty
I'll be the only person in the nursing home flirting.
Pinching nurses asses when I'm jackin' off with Jergens
And I'm jerking, but this whole bag of Viagra isn't working
And every single person is a Slim Shady lurkin' he could be workin' at Burger King
Spitten on your onion rings
Or in the parking lot circling,
Screaming I don't give a fuck with his windows down and system up
So will the real Shady, please stand up
And put one of those fingers on each hand up
And to be proud to be outta your mind and outta control
And one more time, loud as you can, how does it go?
I'm Slim Shady, yes I'm the real Shady
All you other Slim Shadys are just imitating
So won't the real Slim Shady, please stand up,
Please stand up,
Please stand up
'Cause I'm Slim Shady, yes I'm the real Shady
All you other Slim Shadys are just imitating
So won't the real Slim Shady, please stand up,
Please stand up,
Please stand up
'Cause I'm Slim Shady, yes I'm the real Shady
All you other Slim Shadys are just imitating
So won't the real Slim Shady, please stand up,
Please stand up,
Please stand up
'Cause I'm Slim Shady, yes I'm the real Shady
All you other Slim Shadys are just imitating
So won't the real Slim Shady, please stand up,
Please stand up,
Please stand up
Haha, I guess there's a Slim Shady in all of us,
Fuck it,
Let's all stand up
#!/bin/bash
dirpath=$(dirname ${1})
cat $1 > $dirpath/output
cuss=$(cat $2)
n=$(echo $cuss | wc -w)
while [ 0 -lt $n ]
do
var=$(echo $cuss | cut -d' ' -f $n)
sed "s/\b$var\b/bleep/Ig" $dirpath/output > $dirpath/temp
cat $dirpath/temp > $dirpath/output
((n--))
done
rm $dirpath/temp
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment