Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Roni Laukkarinen
@rolle@mementomori.social  ·  activity timestamp 3 weeks ago

Bash cheat sheet right at your fingertips:

function ch() {
if [ $# -eq 2 ]; then
curl "cht.sh/$1/$2";
else
curl "cht.sh/$1";
fi;
}
alias cs='chtsh'

#Linux #Bash

  • Copy link
  • Flag this post
  • Block
Guillaume Betous
@gbetous@mastodon.tetaneutral.net replied  ·  activity timestamp 3 weeks ago
@rolle I never used the 2 arguments style. Can you give an example ? Thanks !
  • Copy link
  • Flag this comment
  • Block
Roni Laukkarinen
@rolle@mementomori.social replied  ·  activity timestamp 3 weeks ago
@gbetous

ch go for
ch go/for

$ ch go/for
// There's only `for`, no `while`, no `until`
for i := 1; i < 10; i++ {
}
for ; i < 10;  { // while - loop
}
for i < 10  { // you can omit semicolons if there is only a condition
}
for { // you can omit the condition ~ while (true)
}
$ ch go/for // There's only `for`, no `while`, no `until` for i := 1; i < 10; i++ { } for ; i < 10; { // while - loop } for i < 10 { // you can omit semicolons if there is only a condition } for { // you can omit the condition ~ while (true) }
$ ch go/for // There's only `for`, no `while`, no `until` for i := 1; i < 10; i++ { } for ; i < 10; { // while - loop } for i < 10 { // you can omit semicolons if there is only a condition } for { // you can omit the condition ~ while (true) }
  • Copy link
  • Flag this comment
  • Block
Flippin' 'eck, Tucker!
@losttourist@social.chatty.monster replied  ·  activity timestamp 3 weeks ago
@rolle Is this not a very minimal reimplementation of manbut requiring vastly more resources and a network connection? 😅
  • Copy link
  • Flag this comment
  • Block
ticho
@ticho@mas.to replied  ·  activity timestamp 3 weeks ago
@losttourist @rolle Indeed, this cht.sh sounds like something that could benefit from having a locally downloadable collection where you can then point your script(s), instead of shooting HTTP calls out every time.
  • Copy link
  • Flag this comment
  • Block
🇳𝗮ꜟ𝖼𝘩
@Naich@fosstodon.org replied  ·  activity timestamp 3 weeks ago
@rolle
I love bash. It's so wonderfully random that it feels like you are dabbling in the dark arts with mystic runes and incantations. A bit like regex, but for people who don't want to be driven completely insane.
  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.2.11 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct