FG
💻 Software

how to properly use $1 in an alias with two arguments

Fresh5 days ago
Mar 15, 202613663 views
Confidence Score0%
0%

Problem

i have to compare a number of files and I don't want to change the command in two places all the time. so i want to create an alias in bash. so that i can get just by typing

Error Output

alias gd='gvimdiff $1 dir/$1'

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: how to properly use $1 in an alias with two arguments

Low Risk

You cannot use aliases this way, however, you can define a function do to the same thing.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment