{"id":1576,"date":"2014-09-04T13:37:53","date_gmt":"2014-09-04T12:37:53","guid":{"rendered":"http:\/\/denbeke.be\/blog\/?p=1576"},"modified":"2014-09-04T13:37:53","modified_gmt":"2014-09-04T12:37:53","slug":"fish-shell-sudo","status":"publish","type":"post","link":"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/","title":{"rendered":"Fish shell &#038; sudo !!"},"content":{"rendered":"<p>Het gebeurt maar al te vaak dat je in de terminal een commando opnieuw wilt uitvoeren maar dan met <code>sudo<\/code> ervoor. Op de meeste systemen typ je dan <code>sudo !!<\/code> om het vorige commando als super user uit te voeren, maar <a title=\"fish shell\" href=\"http:\/\/denbeke.be\/blog\/software\/fish-een-handige-gebruiksvriendelijke-command-line-shell\/\">fish shell<\/a> doet dat niet.<\/p>\n<p>Het is echter mogelijk om de <code>sudo<\/code> functie te herdefini\u00ebren om dit probleem op te lossen.<\/p>\n<pre><code>function sudo\r\n    if test \"$argv\" = !!\r\n        eval command sudo $history[1]\r\n    else\r\n        command sudo $argv\r\n    end\r\nend<\/code><\/pre>\n<p>Je maakt een nieuwe file aan in <code>~\/.config\/fish\/functions\/<\/code> met de naam van de functie. De functie wordt dus opgeslagen in het bestand <code>~\/.config\/fish\/functions\/sudo.fish<\/code>.<\/p>\n<p>Vanaf nu kan je weer\u00a0<code>sudo !!<\/code> gebruiken in fish!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Het gebeurt maar al te vaak dat je in de terminal een commando opnieuw wilt uitvoeren maar dan met sudo ervoor. Op de meeste systemen typ je dan sudo !! om het vorige commando als super user uit te voeren, maar fish shell doet dat niet. Het is echter mogelijk om de sudo functie te [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[161],"tags":[205,202],"class_list":["post-1576","post","type-post","status-publish","format-standard","hentry","category-software","tag-shell","tag-terminal","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Fish shell &amp; sudo !! &#8211; DenBeke<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fish shell &amp; sudo !! &#8211; DenBeke\" \/>\n<meta property=\"og:description\" content=\"Het gebeurt maar al te vaak dat je in de terminal een commando opnieuw wilt uitvoeren maar dan met sudo ervoor. Op de meeste systemen typ je dan sudo !! om het vorige commando als super user uit te voeren, maar fish shell doet dat niet. Het is echter mogelijk om de sudo functie te [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/\" \/>\n<meta property=\"og:site_name\" content=\"DenBeke\" \/>\n<meta property=\"article:published_time\" content=\"2014-09-04T12:37:53+00:00\" \/>\n<meta name=\"author\" content=\"Mathias Beke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:site\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mathias Beke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/fish-shell-sudo\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/fish-shell-sudo\\\/\"},\"author\":{\"name\":\"Mathias Beke\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\"},\"headline\":\"Fish shell &#038; sudo !!\",\"datePublished\":\"2014-09-04T12:37:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/fish-shell-sudo\\\/\"},\"wordCount\":91,\"commentCount\":0,\"keywords\":[\"shell\",\"terminal\"],\"articleSection\":[\"Software\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/fish-shell-sudo\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/fish-shell-sudo\\\/\",\"url\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/fish-shell-sudo\\\/\",\"name\":\"Fish shell & sudo !! &#8211; DenBeke\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#website\"},\"datePublished\":\"2014-09-04T12:37:53+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/fish-shell-sudo\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/fish-shell-sudo\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/fish-shell-sudo\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fish shell &#038; sudo !!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/\",\"name\":\"DenBeke\",\"description\":\"Mathias Beke\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\",\"name\":\"Mathias Beke\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"caption\":\"Mathias Beke\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fish shell & sudo !! &#8211; DenBeke","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/","og_locale":"en_US","og_type":"article","og_title":"Fish shell & sudo !! &#8211; DenBeke","og_description":"Het gebeurt maar al te vaak dat je in de terminal een commando opnieuw wilt uitvoeren maar dan met sudo ervoor. Op de meeste systemen typ je dan sudo !! om het vorige commando als super user uit te voeren, maar fish shell doet dat niet. Het is echter mogelijk om de sudo functie te [&hellip;]","og_url":"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/","og_site_name":"DenBeke","article_published_time":"2014-09-04T12:37:53+00:00","author":"Mathias Beke","twitter_card":"summary_large_image","twitter_creator":"@MthsBk","twitter_site":"@MthsBk","twitter_misc":{"Written by":"Mathias Beke","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/#article","isPartOf":{"@id":"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/"},"author":{"name":"Mathias Beke","@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc"},"headline":"Fish shell &#038; sudo !!","datePublished":"2014-09-04T12:37:53+00:00","mainEntityOfPage":{"@id":"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/"},"wordCount":91,"commentCount":0,"keywords":["shell","terminal"],"articleSection":["Software"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/","url":"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/","name":"Fish shell & sudo !! &#8211; DenBeke","isPartOf":{"@id":"https:\/\/denbeke.be\/blog\/#website"},"datePublished":"2014-09-04T12:37:53+00:00","author":{"@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc"},"breadcrumb":{"@id":"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/denbeke.be\/blog\/software\/fish-shell-sudo\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/denbeke.be\/blog\/"},{"@type":"ListItem","position":2,"name":"Fish shell &#038; sudo !!"}]},{"@type":"WebSite","@id":"https:\/\/denbeke.be\/blog\/#website","url":"https:\/\/denbeke.be\/blog\/","name":"DenBeke","description":"Mathias Beke","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/denbeke.be\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc","name":"Mathias Beke","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","caption":"Mathias Beke"}}]}},"_links":{"self":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/comments?post=1576"}],"version-history":[{"count":2,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1576\/revisions"}],"predecessor-version":[{"id":1578,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1576\/revisions\/1578"}],"wp:attachment":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/media?parent=1576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/categories?post=1576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/tags?post=1576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}