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.
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
The Hammurderer is quickly becoming regarded as the worst-received advertising mascot since Kool-Aid’s 1989 discontinuation of “The Grapist,” a huge purple monster who sodomizes thirsty children.
It’s a command line tool, used to search and filter text. According to wikipedia it stands for “global regular expression print”, which I never knew til today. Essentially, you give it some input text and a regular expression, and grep outputs all the parts of the input that match the regular expression. For example, if I run the command cat server_logs.log | grep ERROR* on my server, grep will print out all the lines in server_logs.log that have the word “ERROR”, filtering out all the “WARN” and “INFO” logs.
* The | character is called a pipe, and it’s used to pass the output of one command line utility to another. In this example, the command line tool cat prints out the entire text of the file server_logs.log, and that output is then passed as an input to the next utility, grep, who filters it and outputs the filtered result. Piping is unnecessary in this case; in fact I have heard it rather upsettingly referred to as cat abuse, but that’s how my fingers remember how to filter files so I thought I’d present it as I wrote it.
Oh, hahaha. Well, I’m glad you liked it in that case. I’ve been practicing my hand at writing little impromptu social-media sized explainers for technical concepts, and It’s good to get some knowledgeable feedback.
I’ve always assumed the joke was that it sounded like “grope”, and I always thought it was a loose fit for this joke. A bit of a reach, if you will.
unzip, strip, top, less, touch, finger, grep, mount, fsck, more, yes, fsck, fsck, fsck, umount, sleep.
You forgot scrot
'Sup scrote!
Forgot $
Like sex, an operating system is better when it’s free
I changed the $ in bash to § because fuck capitalism, keep your currency out of my free software
How will you escape $var usage in scripts though :P
I’ve… never had to do that. What does it do?
bash uses $ character to indicate variables. for example, you can see your current environment variables with the
envcommand. then to see a specific variableecho $varto 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.
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
That’s the currency in The Sims…
And
!… grep?
To the radiator. It’s not also.
The Onion, March 2002
It’s a command line tool, used to search and filter text. According to wikipedia it stands for “global regular expression print”, which I never knew til today. Essentially, you give it some input text and a regular expression, and
grepoutputs all the parts of the input that match the regular expression. For example, if I run the commandcat server_logs.log | grep ERROR* on my server,grepwill print out all the lines inserver_logs.logthat have the word “ERROR”, filtering out all the “WARN” and “INFO” logs.* The
|character is called a pipe, and it’s used to pass the output of one command line utility to another. In this example, the command line toolcatprints out the entire text of the fileserver_logs.log, and that output is then passed as an input to the next utility,grep, who filters it and outputs the filtered result. Piping is unnecessary in this case; in fact I have heard it rather upsettingly referred to as cat abuse, but that’s how my fingers remember how to filter files so I thought I’d present it as I wrote it.…
https://lemmy.world/search?q=grep&type=All&listingType=All&creatorId=531839&page=1&sort=TopAll&titleOnly=false
I’m familliar with grep, thank you. Although you did something good for people who don’t know.
I mean more, what’s grep innuendo for? The others are fairly obvious.
Oh, hahaha. Well, I’m glad you liked it in that case. I’ve been practicing my hand at writing little impromptu social-media sized explainers for technical concepts, and It’s good to get some knowledgeable feedback.
I’ve always assumed the joke was that it sounded like “grope”, and I always thought it was a loose fit for this joke. A bit of a reach, if you will.
i think it’s like grab, but spelt grep
datePut on the sockets, finger and connect, accept reject.