I want to take file from different directory and pass it to a function as an argument. I have been at this for hours but I can not get it to work. So far I have tried this
#!/bin/bash
myfile=/home/$USER/Desktop/Programs/Files/asd.bam
function mate()
{
samtools index $arg
echo "$arg"
}
mate $myfile
I check argument with echo command but It shows empty.
Thanks in advance.