8.2.2 List of UNIX-compatible commands
Some of the UNIX-compatible commands are provided in the executable file format and some in the script format.
Commands provided in the executable file format
The same JP1/Advanced Shell commands can be used in both Windows and UNIX.
For details about how to specify these commands, see 8.4 UNIX-compatible commands.
Commands provided in the script format (Windows only)
Commands that depend on UNIX functionality are supported in Windows by being provided in the script format, thus enabling you to achieve some of the standard UNIX OS functionality while using the Windows functionality.
For details about how to specify these commands, see 8.5 UNIX-compatible commands (script format) (Windows only).
- Organization of this subsection
(1) Commands provided in the executable file format
Of the UNIX-compatible commands, those provided in the executable file format can be executed within job definition scripts. You can also execute them from the Windows command prompt and UNIX shell.
The UNIX-compatible commands provided in the executable file format are stored at the following locations:
Windows execution environment:
installation-folder\JP1ASE\cmd
Windows development environment:
installation-folder\JP1ASD\cmd
UNIX:
/opt/jp1as/cmd
Amongst the UNIX-compatible commands, for commands that are provided in the executable file format, there are restrictions on controls with large differences between OS such as the file system. For Windows, there are restrictions on owner, group, and access permissions.
The following table describes the limitations on the supported UNIX-compatible commands provided in the executable file format.
Command name |
Overview |
Restrictions# |
---|---|---|
awk |
Performs text processing and pattern matching. |
|
basename |
Obtains a file name from a path name, and then outputs it to the standard output. |
No limitations |
cat |
Outputs files to the standard output. |
No limitations |
cmp |
Compares binary files. |
No limitations |
cp |
Copies files or directories. |
In Windows, the -p option preserves only the modification date and file access time of the source file. Directory information is not preserved. |
cut |
Displays selected parts of lines to the standard output. |
No limitations |
date |
Displays the system date and time. Cannot be used to set the system date and time. |
The -a option (set time) cannot be used. |
diff |
Compares two files. |
No limitations |
dirname |
Retrieves a directory path name excluding any file name from a character string that satisfies the file path naming conventions, and then outputs the result to the standard output. |
No limitations |
egrep |
Searches for characters in files. A specified pattern is treated as an extended regular expression. This is the same processing as when the -E option is specified in the grep command. |
No limitations |
expand |
Replaces the tab character with spaces in a line in which tab stops are set and then outputs the result to the standard output. |
No limitations |
expr |
Evaluates an expression. |
No limitations |
find |
Searches for files in directories. |
No limitations |
getopt |
Analyzes command line options for easy syntax analysis of shell scripts. |
No limitations |
grep |
Searches for characters in files. |
No limitations |
gunzip |
Decompresses compressed files. |
In Windows, the owner, ACL, and attributes of a compressed file are not inherited by the decompressed file. |
gzip |
Compresses or decompresses files. |
|
head |
Shows the first part of files. |
No limitations |
hostname |
Displays the host name (cannot be used to set the host name). |
No limitations |
ln |
Creates a link file for a file or directory. |
In UNIX, hard links cannot be created for the following items:
In Windows, hard links cannot be created for the following items:
In Windows, link files cannot be created in file systems other than NTFS. In Windows, the UNC format cannot be specified for the argument target or a target directory. |
ls |
Lists the contents of files or directories. |
|
mkdir |
Creates directories. |
In Windows, the -m option for setting the mode is ignored. |
mv |
Moves files or directories; changes the name of a file or directory. |
|
paste |
Concatenates multiple files in lines, and then outputs them to the standard output. |
No limitations |
printf |
Converts values or character strings according to the form, and then outputs them to the standard output. |
No limitations |
rm |
Removes files or directories. |
In Windows, only the access permissions of the owner are visible when overwriting. |
rmdir |
Removes empty directories. |
No limitations |
sed |
Replaces character strings in text. |
No limitations |
sleep |
Stops for a specified period of time. |
No limitations |
sort |
Sorts text files |
No limitations |
split |
Splits a file. |
No limitations |
stat |
Outputs the statuses of files and directories to the standard output. |
|
tail |
Outputs the last part of files. |
No limitations |
tar |
Stores the file or directory in the archive and extracts/displays the file or directory from the archive. |
|
touch |
Changes the most recent access date and time or the most recent modification date and time for a file. |
|
tr |
Outputs character strings input from the standard input to the standard output while replacing or deleting characters on a byte-by-byte basis. |
No limitations |
uname |
Displays information about the OS or hardware. |
No limitations |
uniq |
Removes duplicated lines from a sorted file. |
No limitations |
wc |
Counts the number of bytes, lines, characters, or words in a file. |
No limitations |
which |
Obtains the paths of external commands to be executed from the command search path set in the PATH environment variable. |
In Windows, this command supports only those external commands that satisfy the path search rules provided in the description of the which command. |
xargs |
Inputs command arguments from the standard input, and then creates and runs a command line. |
No limitations |
- #
The following limitations apply to all UNIX-compatible commands that are provided in the executable file format:
In Windows, wildcards are not expanded when UNIX-compatible commands are executed from the command prompt. However, they are expanded when used in a job definition script file.
The messages that are output can vary depending on the platform on which the command is executed.
In Windows, you must use double quotation marks when executing commands from the command prompt.
There are limitations to the supported files. For details, see 2.2.3 Files used in JP1/Advanced Shell.
The path conversion functionality is not applicable to the path names generated by commands or to the file names specified in job definition script files.
If you use functionality that runs the following programs to run an application with a GUI interface, the application might terminate at a run time of a batch job:
- system function of the awk command
- Format of the awk command: command-name | getline [variable name]
- Format of the awk command: print [expression[, ... ]] | command-name
- -exec and -ok primaries of the find command
- xargs command
Note also that new jobs are generated when you run the adshexec command.
Restrictions are as follows when, amongst the UNIX-compatible commands, using a hard link or symbolic link in the executable file format:
-
Values might vary between the UNIX edition and Windows edition when the number of hard links for a directory is output with the find command, ls command, and stat command.
-
In Windows, as hard links and symbolic links have become supported from version 11-00, the output format of some UNIX-compatible commands might vary between versions before 11-00 and versions later than 11-00. In order to return the output format to that of a version prior to 11-00 without using hard links or symbolic links, specify L0 for the ADSH_LINK_SUPPORT environment variable. For details on the ADSH_LINK_SUPPORT environment variable, see 2.2.7 Using hard links and symbolic links.
-
When a UNIX-compatible command is executed upon specifying a value other than L0 or L1 for the ADSH_LINK_SUPPORT environment variable, the command will end in an error with a return code of 255 or more.
(2) Commands provided in the script format (Windows only)
The UNIX-compatible commands provided in the script format can be executed only within job definition scripts.
Sample script files for the UNIX-compatible commands provided in the script format are stored at the following locations:
Windows execution environment:
installation-folder\JP1ASE\sample
Windows development environment:
installation-folder\JP1ASD\sample
Before using the UNIX-compatible commands provided in the script format, you must complete the preparations described in (2) Preparations for using the script-format UNIX-compatible commands (Windows only) on the sample script files provided by JP1/Advanced Shell.
The table below lists and describes the supported UNIX-compatible commands in the script format. The provided sample script file is for Windows only. To use these commands in UNIX, use the OS-provided commands.
Command name |
Overview |
---|---|
chmod |
Changes the access permissions of files and folders. |
su |
Executes programs specified in the su command. |
who |
Displays information about the users who are currently logged in. |
Restrictions on when you use a hard link and symbolic link in the script format out of UNIX-compatible commands are as follows:
-
If you specify a value other than L0 and L1 for the ADSH_LINK_SUPPORT environment variable and execute a UNIX-compatible command, the command finishes with the error code 255 or more.