{"action":"created","issue":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/288","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/288/labels{/name}","comments_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/288/comments","events_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/288/events","html_url":"https://github.com/fish-shell/fish-shell/issues/288","id":6324409,"number":288,"title":"sudo: !!: command not found","user":{"login":"cometpeak","id":1227373,"avatar_url":"https://avatars.githubusercontent.com/u/1227373?v=3","gravatar_id":"","url":"https://api.github.com/users/cometpeak","html_url":"https://github.com/cometpeak","followers_url":"https://api.github.com/users/cometpeak/followers","following_url":"https://api.github.com/users/cometpeak/following{/other_user}","gists_url":"https://api.github.com/users/cometpeak/gists{/gist_id}","starred_url":"https://api.github.com/users/cometpeak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cometpeak/subscriptions","organizations_url":"https://api.github.com/users/cometpeak/orgs","repos_url":"https://api.github.com/users/cometpeak/repos","events_url":"https://api.github.com/users/cometpeak/events{/privacy}","received_events_url":"https://api.github.com/users/cometpeak/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fish-shell/fish-shell/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/fish-shell/fish-shell/milestones/4","html_url":"https://github.com/fish-shell/fish-shell/milestones/fish-future","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/milestones/4/labels","id":130257,"number":4,"title":"fish-future","description":"These are bugs that are not targeted for an upcoming release. After a release, we will reexamine these bugs and pull any in that we think are good targets.\r\n\r\nIf you can provide a fix for a bug in this milestone, we'll generally accept it for the next release even if the bug is not in the release.","creator":{"login":"ridiculousfish","id":920838,"avatar_url":"https://avatars.githubusercontent.com/u/920838?v=3","gravatar_id":"","url":"https://api.github.com/users/ridiculousfish","html_url":"https://github.com/ridiculousfish","followers_url":"https://api.github.com/users/ridiculousfish/followers","following_url":"https://api.github.com/users/ridiculousfish/following{/other_user}","gists_url":"https://api.github.com/users/ridiculousfish/gists{/gist_id}","starred_url":"https://api.github.com/users/ridiculousfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridiculousfish/subscriptions","organizations_url":"https://api.github.com/users/ridiculousfish/orgs","repos_url":"https://api.github.com/users/ridiculousfish/repos","events_url":"https://api.github.com/users/ridiculousfish/events{/privacy}","received_events_url":"https://api.github.com/users/ridiculousfish/received_events","type":"User","site_admin":false},"open_issues":393,"closed_issues":70,"state":"open","created_at":"2012-06-11T02:25:13Z","updated_at":"2015-03-12T06:10:34Z","due_on":null,"closed_at":null},"comments":42,"created_at":"2012-08-20T12:44:30Z","updated_at":"2015-03-17T21:21:05Z","closed_at":null,"body":"It appears that the double-bang does not work and is somehow interpreted as a program which sudo unsuccessfully tries to locate. This occurs on Ubuntu 12.04 LTS with fish-shell compiled from source.\n\n## Steps to repro:\n\n1. Execute any command:\n\n    $ ls\n\n2. Execute the previous command as root:\n\n    $ sudo !!\n    sudo: !!: command not found\n\n## Expected behavior:\n\nCommand `sudo !!` executes previously executed command (`ls`) as root.\n\nI also checked that the issue isn't caused by `sudo` by following repro steps in bash, which behaved as expected.\n\nAlso, note that an earlier version of fish-shell on Mac OS X 10.7 did not have this problem and `sudo !!` worked as expected."},"comment":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/comments/82605434","html_url":"https://github.com/fish-shell/fish-shell/issues/288#issuecomment-82605434","issue_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/288","id":82605434,"user":{"login":"gillham","id":627962,"avatar_url":"https://avatars.githubusercontent.com/u/627962?v=3","gravatar_id":"","url":"https://api.github.com/users/gillham","html_url":"https://github.com/gillham","followers_url":"https://api.github.com/users/gillham/followers","following_url":"https://api.github.com/users/gillham/following{/other_user}","gists_url":"https://api.github.com/users/gillham/gists{/gist_id}","starred_url":"https://api.github.com/users/gillham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gillham/subscriptions","organizations_url":"https://api.github.com/users/gillham/orgs","repos_url":"https://api.github.com/users/gillham/repos","events_url":"https://api.github.com/users/gillham/events{/privacy}","received_events_url":"https://api.github.com/users/gillham/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T21:21:05Z","updated_at":"2015-03-17T21:21:05Z","body":"@ridiculousfish You're absolutely right that a '!!' feature request needs to be fairly detailed.  I've never used the particular example you gave as I always do something like this:\r\n$ ls -l some_long_file.txt\r\n$ ^ls-l^cat\r\n\r\nObviously this doesn't work either.  That would be separate feature request for me, that I haven't bothered with since I only started testing fish out recently.\r\n\r\n\"fish: Encountered redirection when expecting a command name. Fish does not allow a redirection operation before a command.\"\r\n\r\nSeems like it would be easy to treat '^' in the command position as a substitution since it isn't conflicting with existing functionality.  But that is a separate issue, just mentioning it since you're right that there should be a clear definition of what '!!' (or just history substitution in general) means.\r\n\r\nHere are a couple examples I use:\r\n```\r\n$ !!\r\n$ some command `!!`\r\n$ !keyword \r\n$ !123\r\n```\r\n"}}