Increase command length for ksh shell on Redhat Linux
I have a ksh shell script and i need to pass arguments which are generated by data pulled from a database.
When the argument to the shell script is too long (about 4000 charecters) the below is the issue observed.
I copy the command which is 4000 charecters long from the logs and paste it for the ksh shell on my RedHat linux; then only part of the command (not the complete copied command text) gets pasted
Can you please help increase / tweak some settings so I can simply copy paste and execute the shell script irrespective of the command length or atleast increase it to a substantial length?
Below are the details:
However, I did not find any of the above variable in /usr/include/limits.h file.
I'm not sure what value I should change and in which file ?
Note: the issue of not being able to paste the entire command only happens with ksh shell. The problem is not seen with bash shell.
It's a hardcoded limit, not something trivially changed. Even if you coerce getconf into changing, it won't be reflected in programs. But I suspect you're using a crusty old pdksh/ksh88, newer ksh is quite willing to accept enormous arguments on Linux.
Looks like i was not able to understand as well as explain the problem.
here is the problem where i'm running the test.sh script and passing a very long argument with terminal set to ksh like below.
command i wish to run:
when i copy the above and paste it in my ksh terminal it does not paste the entire copied text but only till say "argtwohundredfour" as below.
I then have to copy the remaining args and add to the previous manually. entire thing does not get copied in one go in ksh like it does in bash.
That is the problem. If there is a solution to this I will be excited to know.
Maybe you hit the LINE_MAX=2048?
This should be the buffer for a physical line (usually an input line).
Try to construct a longer virtual line by inserting a \ at the very end of the physical line, and continue on the next physical line.
For example
Maybe you hit the LINE_MAX=2048?
This should be the buffer for a physical line (usually an input line).
Try to construct a longer virtual line by inserting a \ at the very end of the physical line, and continue on the next physical line.
For example
Any other solution please ? As the arguments are constructed by variable substituted values constructed at runtime.
Considering I have root privileges , can I modify this setting somewhere ?
Last edited by mohtashims; 10-15-2019 at 05:57 PM..
xargs is cheating: it runs the ksh with max_args then again with the remaining args...
I've verified that it's not cheating in my case by having the script print an extra character. The count would be out several more if ksh were being run repeatedly.
Is there a maximum length for a shell script command? How can I detect that in my OS?
For example, if I have something like:
command A | command B | command C | awk '{print $1 $2 $3 $4 $5}'
then can we break the commands and also the arguments inside awk ?
Thanks (11 Replies)
Hi,
This is my first post to this site. So kindly forgive if I am writing in a wrong section.
My query is that...
I want to modify the max username length size. I guess it is 32/64 on CentOS. Now I want to change it to 128. Is there any way to do that?
Thanks in advance!! :) (4 Replies)
Guys,
I would like to discuss the problem I am seeing with echo “\n” statement in Redhat Linux Enterprise 5.3 version. I have a shell script that was written couple of years back for generic UNIX platforms based on ksh and was tested on Solaris 8,9,10 ; AIX 5.3 and Red Hat Enterprise Linux... (5 Replies)
Hi,
I wanted to know what is the maximum length of command which can be run on a bourne (sh) shell? Where can I find that information? Is it different for different OS flavors?
Please help.
Thanks,
Vineet (10 Replies)
Hello All,
I am using RHEL 4. Currently maximum password length limit is set to 8 on my system.
Please tell what do i need to change to increase this limit to say 20. I changed the login.defs and included the following line -
"
PASS_MAX_LEN 20
"
but this dint work.
I further... (7 Replies)
Hi,
I need to create a file of record length more than 300 characters.
But in my unix box, i am able to create a file only with a maximum of 256 characters per record.
Is there anyway i can create a file with more than 300 characters in this case?
Or How to increase the maximum record... (1 Reply)
Hi All,
I need to know RedHat linux version installed on a different servers.
I know uname -a or /proc/version
Is any other command to know the Linux version????
When we telnet to any of the Linux server, the version shows very clearly like
Red Hat Enterprise Linux ES release 3 (Taroon... (1 Reply)
I am new to mysql database ,
we have a mysql database running on linux , and we use mysql database for bugzilla, so we wanted to take a backup .
what is the command for taking the entire database backup
from the command prompt with all options.
Thanks in advance
Bache Gowda (4 Replies)