I need help, I can't create an alias with a variable to grep a file on a remote server.
I have tried:
alias searchword="ssh -t user@server "grep -i \"$1\" /root/file.txt\""
alias search="ssh -t user@server 'grep -i $1 '\'"/root/file.txt\'"
If I send the command from the console it works, the problem comes when creating an alias.
Can you help me?