Trying to connect with remote server and find timestamp of a file but getting invalid command error

sanjoy

New Member
Joined
Apr 2, 2020
Messages
1
Reaction score
0
Credits
0
This is my sample code but it's not working getting invalid command error in stat command, the connection is successful but stat command is not working. stat command is installed in both servers local and remote. Thanks in Advance.
#!/bin/bash
host=--
user=--
pass=--

ftp -inv $host <<EOF
user $user $pass
cd /desktop/suman
dst_file="suman.txt"
filetime=$(stat -c %Y "${dst_file}")
echo filetime
bye
EOF
 

Members online


Top