▲ 811 ▼ Terminology (lemmy.world) submitted 2 months ago by cannedtuna@lemmy.world to c/programmer_humor@programming.dev 68 comments fedilink hide all child comments
[–] dry_water@programming.dev 5 points 2 months ago (6 children) How will you escape $var usage in scripts though :P permalink fedilink source parent hideshow 6 child comments replies: [–] wonderingwanderer@sopuli.xyz 3 points 2 months ago (5 children) I've... never had to do that. What does it do? permalink fedilink source parent hideshow 5 child comments replies: [–] oozynozh@sh.itjust.works 3 points 2 months ago (2 children) bash uses $ character to indicate variables. for example, you can see your current environment variables with the env command. then to see a specific variable echo $var to print its value. scripts may call variables for a variety of reasons. one common case would be collecting information from the environment it's running under to determine whether it's compatible. permalink fedilink source parent hideshow 2 child comments replies: [–] wonderingwanderer@sopuli.xyz 2 points 2 months ago (1 child) Oh. Oh yeah, I have done that. Like for adding the date to a file name when I dump a terminal output to into a text file, or adding hit counts to a custom notification after running a scan on a cron job. I just use the character for that. It's fine, can't win them all, but it's better than having it at the beginning of every command line for seemingly no reason permalink fedilink source parent hideshow 1 child comment replies: [–] oozynozh@sh.itjust.works 1 point 2 months ago bingo permalink fedilink source parent [–] dry_water@programming.dev 1 point 2 months ago (1 child) Was referring to https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Bash-Variables permalink fedilink source parent hideshow 1 child comment replies: [–] wonderingwanderer@sopuli.xyz 2 points 2 months ago Got it, yeah someone else already explained it and it turns out I have used it permalink fedilink source parent
[–] wonderingwanderer@sopuli.xyz 3 points 2 months ago (5 children) I've... never had to do that. What does it do? permalink fedilink source parent hideshow 5 child comments replies: [–] oozynozh@sh.itjust.works 3 points 2 months ago (2 children) bash uses $ character to indicate variables. for example, you can see your current environment variables with the env command. then to see a specific variable echo $var to print its value. scripts may call variables for a variety of reasons. one common case would be collecting information from the environment it's running under to determine whether it's compatible. permalink fedilink source parent hideshow 2 child comments replies: [–] wonderingwanderer@sopuli.xyz 2 points 2 months ago (1 child) Oh. Oh yeah, I have done that. Like for adding the date to a file name when I dump a terminal output to into a text file, or adding hit counts to a custom notification after running a scan on a cron job. I just use the character for that. It's fine, can't win them all, but it's better than having it at the beginning of every command line for seemingly no reason permalink fedilink source parent hideshow 1 child comment replies: [–] oozynozh@sh.itjust.works 1 point 2 months ago bingo permalink fedilink source parent [–] dry_water@programming.dev 1 point 2 months ago (1 child) Was referring to https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Bash-Variables permalink fedilink source parent hideshow 1 child comment replies: [–] wonderingwanderer@sopuli.xyz 2 points 2 months ago Got it, yeah someone else already explained it and it turns out I have used it permalink fedilink source parent
[–] oozynozh@sh.itjust.works 3 points 2 months ago (2 children) bash uses $ character to indicate variables. for example, you can see your current environment variables with the env command. then to see a specific variable echo $var to print its value. scripts may call variables for a variety of reasons. one common case would be collecting information from the environment it's running under to determine whether it's compatible. permalink fedilink source parent hideshow 2 child comments replies: [–] wonderingwanderer@sopuli.xyz 2 points 2 months ago (1 child) Oh. Oh yeah, I have done that. Like for adding the date to a file name when I dump a terminal output to into a text file, or adding hit counts to a custom notification after running a scan on a cron job. I just use the character for that. It's fine, can't win them all, but it's better than having it at the beginning of every command line for seemingly no reason permalink fedilink source parent hideshow 1 child comment replies: [–] oozynozh@sh.itjust.works 1 point 2 months ago bingo permalink fedilink source parent
[–] wonderingwanderer@sopuli.xyz 2 points 2 months ago (1 child) Oh. Oh yeah, I have done that. Like for adding the date to a file name when I dump a terminal output to into a text file, or adding hit counts to a custom notification after running a scan on a cron job. I just use the character for that. It's fine, can't win them all, but it's better than having it at the beginning of every command line for seemingly no reason permalink fedilink source parent hideshow 1 child comment replies: [–] oozynozh@sh.itjust.works 1 point 2 months ago bingo permalink fedilink source parent
[–] dry_water@programming.dev 1 point 2 months ago (1 child) Was referring to https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Bash-Variables permalink fedilink source parent hideshow 1 child comment replies: [–] wonderingwanderer@sopuli.xyz 2 points 2 months ago Got it, yeah someone else already explained it and it turns out I have used it permalink fedilink source parent
[–] wonderingwanderer@sopuli.xyz 2 points 2 months ago Got it, yeah someone else already explained it and it turns out I have used it permalink fedilink source parent