Sponsored Content
Top Forums Shell Programming and Scripting Maximum command length in bourne shell Post 302365861 by vgersh99 on Wednesday 28th of October 2009 08:19:03 AM
Old 10-28-2009
Code:
#!/bin/ksh

# The value of the constant ARG_MAX defines how long an argument list your
# kernel can take on the command line before it chokes. Here's a script to
# find out the value of it:

        # Print out the system's architecture
        uname -rms              # or uname -a

        # Let the C preprocessor read in the system's limits from limits.h
        # and then expand the macro ARG_MAX
        # Filter out excess output (there will be some line number information
        # and a gadzillion empty lines)
        #
        # On some gcc systems, I have been unable to find a working cpp.
        # You can use gcc -E - <:<:HERE | tail -1 in that case.

cpp <<HERE | tail -1    # Only the last line is interesting
#include <limits.h>
ARG_MAX
HERE

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Maximum file name length

Hi folks, Can anybody tell me whether there is any limit on the file name length and directory name length in UNIX. (4 Replies)
Discussion started by: rkkiran
4 Replies

2. UNIX for Dummies Questions & Answers

Maximum Command Length for Korn shell

What is the maximum size of a command which can be given in telnet command prompt in unixfor Korn shell? (2 Replies)
Discussion started by: miltony
2 Replies

3. UNIX for Dummies Questions & Answers

Maximum Command Length

What is the maximum size of a command which can be given in telnet command prompt in unix? (2 Replies)
Discussion started by: miltony
2 Replies

4. UNIX for Dummies Questions & Answers

what is the maximum length of th os-command line in Unix.

Hi All, I didn't find any thread that match this question so I hope it's not redundant. I am totally new to Unix. I want to know what is the maximum length of the os-commandline in Unix. Will it cause any problem if I run any application whose total path length is much longer than 256... (2 Replies)
Discussion started by: kumardesai
2 Replies

5. UNIX for Dummies Questions & Answers

Maximum length of a path given as an argument to a shell script

hi, I am using solaris10. I have to write a bourne shell script, which copies files for the said destination path which is passed as an argument to the script. it looks like this myscript.sh /var/test -->destination path now i would like to know what is the maximum length i can... (3 Replies)
Discussion started by: raghu.amilineni
3 Replies

6. Shell Programming and Scripting

what is the maximum length of a unix shell variable which can be can passed to plsql

what is the maximum length of a unix shell variable which can be can passed to plsql variable:( (1 Reply)
Discussion started by: alokjyotibal
1 Replies

7. Shell Programming and Scripting

Is there any command in the Bourne shell?

Hi, The problem I have is that I want to create a list of folders whose names are read from a text file but the file names are in decimal. Each letter consists of an octet and the end of the folder name is defined by the white space character (0032) For example, we have in the text... (2 Replies)
Discussion started by: Gengis-Kahn
2 Replies

8. AIX

Alias Command in Bourne Shell

Hi My Unix sever is AIX 5.3. My Login shell ( using echo $SHELL) is /bin/sh implying it is a Bourne Shell. My Question is that i am still able to use Alias command to create/retrieve aliases. I have read in several sites on Unix online that the Bourne Shell does not support Aliases but... (12 Replies)
Discussion started by: pchegoor
12 Replies

9. Shell Programming and Scripting

Is there a maximum length for a shell script command?

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)
Discussion started by: hbar
11 Replies

10. Shell Programming and Scripting

Maximum length of a string

good friends days I would love to know if I can help you know the length of a string example: cadena= "cual es mi largo" echo "cadena : $cadena# cadena :16 (7 Replies)
Discussion started by: tricampeon81
7 Replies
arch(1) 							   User Commands							   arch(1)

NAME
arch - display the architecture of the current host SYNOPSIS
arch [-k | archname] DESCRIPTION
The arch utility displays the application architecture of the current host system. Due to extensive historical use of this command without any options, all SunOS 5.x SPARC based systems will return "sun4" as their application architecture. Use of this command is discouraged. See NOTES section below. Systems can be broadly classified by their architectures, which define what executables will run on which machines. A distinction can be made between kernel architecture and application architecture (or, commonly, just "architecture"). Machines that run different kernels due to underlying hardware differences may be able to run the same application programs. OPTIONS
-k Displays the kernel architecture, such as sun4u. This defines which specific SunOS kernel will run on the machine, and has implica- tions only for programs that depend on the kernel explicitly (for example, ps(1)). OPERANDS
The following operand is supported: archname Use archname to determine whether the application binaries for this application architecture can run on the current host sys- tem. The archname must be a valid application architecture, such as sun4, i86pc, and so forth. If application binaries for archname can run on the current host system, TRUE (0) is returned. Otherwise, FALSE (1) is returned. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
mach(1), ps(1), uname(1), attributes(5) NOTES
This command is provided for compatibility with previous releases and its use is discouraged. Instead, the uname command is recommended. See uname(1) for usage information. SunOS 5.11 21 Oct 2002 arch(1)
All times are GMT -4. The time now is 10:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy