Tealk
1
Hi,
When I run the following in terminal, nautilus comes up normally and connects me to the server:
Code
nmcli con up id pfSense; nautilus 'sftp://nextcloud/root
But when I create the following as alias and run it with sftpv nextcloud
I get 2 error messages:
alias sftpv="nmcli con up id pfSense; nautilus 'sftp://${1}/root'"


I just don’t quite understand why my variable doesn’t work in this case.
I created the same with ssh and there the variable works
dalto
2
When you use '
(single quotes) ${1}
doesn’t get expanded. Try it without the single quotes.
Does this work?
alias sftpv="nmcli con up id pfSense; nautilus \"sftp://${1}/root\""
EDIT: Actually, can you use $1
in an alias by default in bash? I don’t think you can.
You can use a function instead.
unalias sftpv
function sftpv() { nmcli con up id pfSense; nautilus "sftp://${1}/root"; }
1 Like
Tealk
3
so the ssh command works, only the nautilus command does not
alias sshv="nmcli con up id pfSense; ssh ${1}"
no it does not work
can i write the function in bashrc and call it via sftpv?
system
Closed
5
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.