Escaping Quotes in Chef Bash

0 votes

This I need quotes in a cronjob which I am creating through a chef recipe but even though I escape the quotes they do not appear in the cronjob which is created.

bash "Add cron" do
  user root
  group root
  code <<-EOH
      (
        (crontab -l; echo "5 0 * * * /bin/find #{node['user']['dir']}/files/ -type f \\( -name \"*.csv\" -o -name \"*.csv.bad\" -o -name \"*.ctrl\" \\) -mtime +1 -print0 | xargs -0 gzip -f" ) | crontab -
       )     
  EOH
end

just to clarify the cron job I want to end up with should contain -name "*.csv"

but what I actually get is -name *.csv

Jun 21 in Linux Administration by Korak
• 5,820 points
7 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Linux Administration

0 votes
1 answer

Difference between single and double quotes in Bash

Single statements will not add anything, however ...READ MORE

answered Jun 7 in Linux Administration by Korak
• 5,820 points
16 views
0 votes
1 answer

Difference between single and double quotes in Bash

Single statements will not insert anything, yet ...READ MORE

answered Jun 10 in Linux Administration by Korak
• 5,820 points
8 views
0 votes
1 answer

How to keep quotes in Bash arguments?

utilizing "$@" will substitute the contentions as ...READ MORE

answered Jun 13 in Linux Administration by Korak
• 5,820 points
13 views
0 votes
1 answer

How to take input from user in bash script?

You can use if-else branch to check ...READ MORE

answered Jan 31, 2019 in Linux Administration by Omkar
• 69,210 points
441 views
0 votes
1 answer

Comparing two string variables in an 'if' statement in Bash

1. For string comparison, use: if [ "$s1" ...READ MORE

answered May 15, 2019 in Linux Administration by Shubham
• 13,490 points
348 views
0 votes
1 answer

How to extract file base name without path and extension in bash?

You don't actually have to call the ...READ MORE

answered May 31, 2019 in Linux Administration by Shubham
• 13,490 points
4,171 views
0 votes
1 answer

Script file name in a Bash script

$0 will give you the complete basename. ...READ MORE

answered Jun 20, 2019 in Linux Administration by Shubham
• 13,490 points
248 views
0 votes
1 answer

Select sections of text from each line of files in a Bash shell.

Hi@akhtar, There is no inbuild command available for ...READ MORE

answered Oct 20, 2020 in Linux Administration by MD
• 95,360 points
174 views
0 votes
1 answer

How to find the first field from a file in Bash Shell?

Hi@akhtar, You can extract text from a file. ...READ MORE

answered Oct 20, 2020 in Linux Administration by MD
• 95,360 points
281 views
0 votes
0 answers

Run text file as commands in Bash

If I have a text file with ...READ MORE

Apr 13 in Linux Administration by Aditya
• 7,280 points
20 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP