This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hello everyone,
I have got a couple friends to try out OTW's Bandit to get some hands-on with Linux. I wanted to come up with a system for connecting to each level. Initially, I was just creating a variable $LVL
and redefining it to a new number every time I exit the ssh connection and move on to the next part.
However, after recently starting to create my own command aliases, I wanted to try that. The idea is so that I can just say banditssh levelnumber
I need to still learn more bash scripting fundamentals. I have one alias I copied from a video:
alias pf="ps -e | grep $1"
(Where $1
is the first argument given) - when I saw this, I was so excited. I wanted to try and use that method of writing arguments in my next commands.
I tried this (naively):
alias banditssh="ssh [email protected] -p 2220"
So yeah, I realized it gets read as a (blank) variable instead of an argument when I try banditssh 2
What would my solution be here? I feel like I'm being stupid and missing something simple. Is the only way to keep redefining the variable and then calling ssh from history again? It's not too troublesome, but I just want to learn.
Subreddit
Post Details
- Posted
- 5 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/linuxquesti...