Is there a way to define a 90-degrees-angle pattern for (straight) lines in TikZ?

The pattern should follow the line direction.
Is there a way to define a 90-degrees-angle pattern for (straight) lines in TikZ?

The pattern should follow the line direction.
If you don't mind white painted arrows then it is kind of easy but might need tweaking to get the spacing right.
\documentclass[border=5mm,tikz]{standalone}
\usetikzlibrary{decorations.markings,arrows.meta}
\begin{document}
\begin{tikzpicture}[arrow marks/.style={
decoration={
markings,pre length=2\pgflinewidth,post length=.5\pgflinewidth,
mark={
between positions 0 and 1 step 0.2 with {
\arrow[white,line width=1.1\pgflinewidth]{Fast Triangle}
}
}
}
}
]
\draw[line cap=round,line width=5mm,postaction=decorate,arrow marks] (0,0) -- (5,0);
\end{tikzpicture}
\end{document}

Depending on your use case you can add more and more options where to start where to end what to do if there is a corner on the path etc. If you don't want it to be painted to white then you have to create the initial and the final parts of the path manually and place black parts instead.
Here's a simple Metapost approach for an arbitrary path.

You could make the decoration loop into a function if you wanted to use it often.
prologues := 3;
outputtemplate := "%j%c.eps";
beginfig(1);
z1 = origin;
z2 = (144,34);
path p; p = z1 {right} .. z2;
draw p withpen pencircle scaled 2;
% make the corners and ends squared
interim linecap := squared;
interim linejoin := mitered;
% n = number of chevrons, s=number to skip at start and end
% w = chevron width
n = 50; s=2; w=1;
for i=s upto n-s:
undraw (left--origin--up) scaled 2
rotated 45
rotated angle direction i/n of p
shifted point i/n of p
withpen pencircle scaled w;
endfor
endfig;
end.