Unix - Binary File

Hi All,

I am newbie to this forum. I am also new to shell script world.

I don't understand the below shell script.

File Name: sendFile.sh

#!/bin/bash
#
# This script invokes the Connect:Direct UNIX CLI
# and submits a process inline to copy a file to a remote
# node.
#  $1 is the source file.
#  $2 is the destination file.
#  $3 is the name of the remote node.
#
set -v
/opt/cdunix/ndm/bin/ndmcli  -x << EOJ
submit
test process snode=$3
send    copy    from    (pnode
file=$1
disp=shr)
compress
to      (snode
file=$2
disp=(RPL,CATLG,DELETE)
)
pend;
quit;
EOJ

#1:

This script is being used to transfer the file from Unix to Windows.
But I don't see the FTP command in the code. How come it is possible? This is my first question.

#2:

I would like to know the file transfer mode (i.e either Binary or ASCII) used by Unix. what is the default mode used by unix?

#3:

Incase if the mode is 'ASCII', I would like to change the mode from ASCII to Binary. How to change it? what is the command used to change the mode?

Inputs are welcome!

Regards
Karthik

Hello Karthik,

"ndmcli" is doing the file transfer here. Google for it for more options and syntax of it.

Regards
Ravi

Hi

The script uses Connect Direct to transfer files.
It calls the command line interface and issues the commands to
/opt/cdunix/ndm/bin/ndmcliIf I re-call, if the transfer mode is not set, it defaults to binary.
You can check the Connect Direct documentation for more info.

While sending the file from a unix server to a windows server using NDM, we are facing the below issue -
msgid=LSMI012E stext=The remote node was not found in the netmap.
NDM is installed in both the servers. user name configurations are done.
The remote node has been added in the netmap.cfg file.
But still we face this issue.
Any idea on this issue?