Hitachi

JP1 Version 11 JP1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide 


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.

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:

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.

Table 8‒2: UNIX-compatible commands (executable file format)

Command name

Overview

Restrictions#

awk

Performs text processing and pattern matching.

  • In Windows, if you specify a file or directory name that contains wildcards in an argument to a command that executes the system function, the wildcards are not expanded.

  • In Windows, if you specify a file or directory name that contains wildcards in an argument to a command connected by a pipe to the getline, print, or printf function, the wildcards are not expanded.

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.

  • In Windows, the owner, ACL, and attributes of a file to be compressed are not inherited by the compressed file.

  • In Windows, the owner, ACL, and attributes of a compressed file are not inherited by the decompressed file.

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:

  • Directories

  • Files that do not exist

  • Files having different file systems

In Windows, hard links cannot be created for the following items:

  • Directories

  • Symbolic links for a directory

  • Files that do not exist

  • Files having different drive letters

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.

  • In Windows, access permissions cannot be displayed for those other than the owner of a group or file with the -l option.

  • In Windows, the TZ environment variable does not apply to output. The time zone set in the Date and Time control panel is used.

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.

  • In Windows, only the access permissions of the owner are visible when overwriting.

  • In Windows, changing the owner is not supported in the same cases as for the cp command. Owner, group, and mode are not preserved.

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.

  • In Windows, permissions cannot be displayed other than for file owners.

  • In Windows, 0 is always displayed as the information about the number of file blocks and the block size.

  • In Windows, drive numbers are displayed as device numbers.

  • In Windows, 0 is always displayed for an owner's user ID and for a group ID.

  • In Windows, ... is always displayed for an owner's group name.

  • In Windows, 0 is always displayed for the inode number.

  • In Windows, 0 is always displayed for the total size of directories.

  • In Windows, 0 is always displayed for the major and minor device numbers.

  • In Windows, a file's most recent modification date and time is displayed for the file's most recent access date and time and for the file's most recent change date and time information.

  • In Windows, file types other than regular files, directories, and symbolic links cannot be displayed.

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.

  • In Windows, link files cannot be extracted to a file system other than NTFS.

  • In Windows, it is not possible to extract a symbolic link in a state where the destination of the symbolic link does not exist.

  • In Windows, the -p option cannot be used.

  • In Windows, the owner, group, and permission cannot be set for the file when extracting a file from the archive.

touch

Changes the most recent access date and time or the most recent modification date and time for a file.

  • In Windows, the most recent access date and time cannot be changed.

  • In Windows, the most recent modification date and time cannot be changed for a directory.

  • In Windows, the time zone set in the TZ environment variable must match the time zone set in the Date and Time control panel.

  • In Windows, the precision of the modification time set in actual files depends on file system specifications.

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:

(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:

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.

Table 8‒3: UNIX-compatible commands (script format)

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: