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.
square velocity profile
The following mechanism also has a squarevelocity profile. See video at 0.29 for an animation
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.