do not replace variable inside command

  • Hi there,


    I am building an backup script and have a problem. After building an exclude information part for the find command and using it inside the command it is going to be escaping me my ' all the time. At the moment I could fix it using eval - but I would love to not use it. So my question is:

    How can I use a variable containing single quotes and paths inside another command as variable?


    Code part:

    In this command I build for each EXCLUDEPATHS this entry: -not -path '/home/ark/*'

    But this part is escaped in the command: -not -path '\''/home/ark/*'\''

    All in all I just need help with the last command ...


    Can someone help me please?