I would just like to ask if there is a way for UNIX to ignore/overcome the 255 character limit of the command line?
My problem is that I have a really long line of text from a file (300+ bytes) which i have to "echo" and process by adding commands like "sed" to the end of the line, like the following:
echo "xxx really long line of text xxx" | sed -e s/xxx/yyy/g
I have read in here that there are character limits (depends on system), and tested the system I'm using and indeed, it can only process commands not exceeding 255 chars. Have also read on changing the values of ARG_MAX (limits.h) but unfortunately, my access has no permission on changing those values.
Is there a way to overcome this limit without changing system parameters? Like setting a temp buffer for the string of text/commands?
There's no way to "ignore" argument length limits or argument size problems. That's a system limitation. 255 characters is an unusually severe limit, but there's always a limit. No shell syntax is ever going to fit a 10-foot truck under an 8-foot tunnel.
I've seen people pile on more and more braces, backticks, and eval until the shell stops saying "too many arguments" but it's still a 10-foot truck and 8-foot tunnel. If you made it fit, you must have wrecked the truck.
If it won't fit as an argument, you have to pass it by other means, like a file.