In bash I have overlapping quotation marks inmy code that doesn’ allow for wrapping the whole thing quotes again [closed]

Solution for In bash I have overlapping quotation marks inmy code that doesn’ allow for wrapping the whole thing quotes again [closed]
is Given Below:

I’m writing a small bash scrip and I would need this part in quotes but I can’t do it because it will always have parts outside the quotes.

printf '%sn' {a..z} | awk '{print NR}' |
xargs -I num -n 1 bash -c "printf '%sn' {a..z} | awk 'NR==num'"

is there any way to either get rid of the apostrophes inside or get the whole block into quotes?

(sorry for my bad english and if I’m just being dumb about it it’s because this would be my first ever full coding project)

Inside double quotes, you can escape other double quotes like so:

$ echo "a "b" c"
a "b" c

Therefore, you could write

"printf '%sn' {a..z} | awk '{print NR}' | xargs -I num -n 1 bash -c "printf '%sn' {a..z} | awk 'NR==num'""

However, this is probably not the way to go. The question is, why do you need this command in quotes? If you need deeply nested quotes, chances are your script is poorly written (for instance, it could rely on eval). Usually, you can improve your script so that you don’t need deeply nested quotes anymore.