Aliases do not accept parameters. You need to write a function or a separate script.
Bash/Zsh function:
Define the following function in your .bashrc
/.zshrc
depending on what interactive shell you use:
mycommand() {
oj d https://codeforces.com/contest/"$1"/problem/"$2"
}
Shell script:
Create the file mycommand
with the following content in your $PATH
and make it executable:
#!/bin/sh
oj d https://codeforces.com/contest/"$1"/problem/"$2"
$1
and $2
are positional parameters. If you call the script or function like $ mycommand 1348 A
, $0
gets mapped to mycommand, $1
to 1348, $2
to A and so on. We put the double quotes around the variables in case they contain whitespace to prevent word splitting.