Score:0

Binding linux commands

fo flag

Friends,

Is it possible within Linux CLI on Ubuntu to create a script that executes a specific command?

I'm not sure how to call this, but I think it's best explained by an example:

Let's say when I write "checkMyCurl" in the command line, it would exec a "curl -k -H "Content-Type: application/json" -X GET https://www.something.com/" command and output the result. Basically I'm just trying to bind a simple command to execute a larger command so that I wouldn't have to write the complicated command all the time.

Thank you! :)

hr flag
For this case, you could use a simple *shell alias* - see [Aliases](https://www.gnu.org/software/bash/manual/html_node/Aliases.html) in the GNU Bash documentation
masch1na avatar
fo flag
@steeldriver this worked perfectly and was exactly what I was looking for! Awesome!
hr flag
@masch1na you're welcome - see also [In Bash, when to alias, when to script, and when to write a function?](https://unix.stackexchange.com/questions/30925/in-bash-when-to-alias-when-to-script-and-when-to-write-a-function)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.