One of option might be the following
figure source with video
You can adjust the contours of the cam to create a more square profile.
linear actuators
There are linear actuators different versions e.g. with a solinoid or with a planetary gear system e.g. see.
However if they are applicable to your problem is depended on :
- cost
- the forces that you need to apply
- the maximum velocity and acceleration profile.