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:
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?
First of all: what OS, what shell, ...
Second: how about putting the line in a script?
Hi pludi,
Using HP-UX, /bin/ksh.
Yes, im using a script and just doing command line to manually test, I store the line in a variable, like so:
but i still get this upon execution:
I think the last parts of the command are not read anymore, due to the character limit.
Thanks.
---------- Post updated at 07:44 PM ---------- Previous update was at 07:28 PM ----------
Quote:
Originally Posted by CarloM
Why not just pass the file directly to sed?
Hi CarloM,
I'm not sure how to do that. Is there a syntax? I'm used to just piping it in after other 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.
Last edited by Corona688; 11-18-2011 at 12:29 PM..
Hello Guys,
Is there a single line archive command to zip or tar log files which is larger than certain size limit ?
Do let me know if there is any.
Thanks (7 Replies)
I have a topic line in markdown that spans more than 80 characters that i need to add a line break. Markdown is simply treating the line break as a brand new line instead of continuing as a topic line.
Eg:
# This is a very long
line
Markdown interprets it as
This is a very long
line (4 Replies)
Hi Guys,
I have a file which contains multiple lines. I need to split each line 255 characters and then I need to add call statement in the front and semi colon at the end.
I/P:
call sp_rebuildindex('aaa.aaa','column column column column column column column column column column ... (4 Replies)
Hello,
I am using sed command to place a comma dynamically in certain positions. When the position variable exceeds 255 characters, it errors out. I would appreciate if someone can point in the correct direction
sed 's/^\(.\{'"$pos"'\}\)./\1,/' ragha.txt > ragha3.txt
If $pos > 255,... (8 Replies)
Hi,
I want to read a file line by line and exclude the lines that are beginning with special characters. The below code is working fine except when the line starts with hyphen (-) in the file.
for TEST in `cat $FILE | grep -E -v '#|/+' | awk '{FS=":"}NF > 0{print $1}'`
do
.
.
done
How... (4 Replies)
Hello All,
We have a working script which identifies and kills ipcs resources which havent been correctly killed during normal shutdowns.
It is working fine and dandy however there are some issues now.
Environment:
SunOS 5.10 Generic_148888-03 sun4u sparc SUNW,SPARC-Enterprise
... (4 Replies)
Hi guys I am trying to interface with an old industrial scanner through an old PC with an old network card and a copy of Linux.
It now needs to speak to a Windows XP machine, but I have no idea what the Windows equivalent of these functions would are:
echo !1 | nc 255.255.2.2 80
echo ?2 | nc... (3 Replies)
Hello, I am new to this forums. I need help with shell, and ksh in particular. I have a case statement that does something if -k. So it looks like:
case $arg in
-k) PUT=y, SEND=1
Thats all good and dandy. But now I want to change it where whether or not the user puts -k or not, it will do... (2 Replies)
Is there a limit (255 chars?) on the command line??
I'm trying to copy some generated java & class files from one dir to another and ID the old & new versions by:
find . -name FFSFIXADminCallbackBean.java
I then do a copy and paste of the source and target -
$ cp -p source target
It... (7 Replies)