I used to have aliases like:
alias mount-open="sudo mount $(sudo blkid | gawk '/2tb-open/ { print substr($1, 0, 9) }') 2tb-open"
I can't be 100% sure that it was the same, but 100% it was a bash alias, not a bash function, and it had other command inclusion without the use of variables etc.
Now I can't make this work. If I put the double quotes (like in the example), it tries to run some sudo command on terminal startup. If I use single quotes and escape the quotes in the middle:
alias mount-open='sudo mount $(sudo blkid | gawk \'/2tb-open/ { print substr($1, 0, 9) }\') 2tb-open'
it says:
bash: .bashrc: line 25: syntax error near unexpected token `('
I suppose it has something to do with 'extra code' in the default Ubuntu bashrc compared to the Fedora one, which is rather lean. I mean, it worked on Ubuntu. A couple of years ago I installed Fedora and copied the bashrc file from my Ubuntu sytem to it, the aliases etc. worked. It worked in Fedora 32 (with the Ubuntu bashrc) a week ago. But now I had sort of a data loss and I'm trying to 'reinvent' this. Currently I'm using the default Fedora bashrc file, which had only like 15 lines initially
Could anyone suggest how to fix this?
Thank you.
echo $'Don\'t worry'