Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create an alias with a variable in Mac Terminal

Tags:

bash

macos

How do you use variables in an alias? For example if pbcopy will allow me to access the clipboard (copied ip address) and assign it to $ip I could copy an IP address and then use an alias such as the below failed example.

alias go='ip=pbpaste | ssh $ip -l pete'
like image 716
user1541542 Avatar asked Nov 22 '25 16:11

user1541542


1 Answers

I usually use pbpaste/pbcopy, but you may want to find something with a history for your uses.

like image 99
LeGBT Avatar answered Nov 25 '25 09:11

LeGBT