Operating System - HP-UX
1841133 Members
4220 Online
110178 Solutions
New Discussion

length of a command string

 
Wen Geng
Occasional Advisor

length of a command string

Is there a length restriction on the command string in HP-UX 11.0 and if there is, what is the max length permitted?
5 REPLIES 5
Sundar_7
Honored Contributor

Re: length of a command string

getconf LINE_MAX

I do believe this refers to the max length of a command (or a line).
Learn What to do ,How to do and more importantly When to do ?
Wen Geng
Occasional Advisor

Re: length of a command string

getconf LINE_MAX returns 2048. My command line lenth is 258 characters and it fails. If I insert the total command in a file and call it, then it runs fine. Any answers?
Sundar_7
Honored Contributor

Re: length of a command string

what do you mean when you say "it fails"

What kind of error messages do you see when it fails ?
Learn What to do ,How to do and more importantly When to do ?
RAC_1
Honored Contributor

Re: length of a command string

I think it is 255. LINE_MAX appies to max line length in a file.

Anil
There is no substitute to HARDWORK
Ermin Borovac
Honored Contributor

Re: length of a command string

On 11i system maximum number of characters that can be typed on the shell command line is

255 with posix shell (/usr/bin/sh)
512 with korn shell (/usr/bin/ksh)

I think this limit has something to do with MAX_CANON in /usr/include/limits.h.

# define _POSIX_MAX_CANON 255 /* Max number of bytes in a terminal
# define MAX_CANON 512 /* Max number of bytes in a terminal canonical