You cannot just do expect "$fname" to test the existence of remote files. Try:
Note how we need to do one expect for "YES\r" first to capture the echo back from the sent string. The second expect is looking for any output from the command. You could also do this with one expect looking for "YES\r\nYES"
This User Gave Thanks to Chubler_XL For This Post:
Hi All,
I am new to shell scripting.
Can someone let me know, how to check whether the user exists in the remote system?
I am building a new unix box and before I proceed installing the appliation , I want to check whether the required users are created in the system .
how to do this ?... (1 Reply)
Hi there, I am designing a software rollout script and need to check if a particular file exists on a remote system
something along the lines of
if ; then blah blah
The above doesnt work but you get the general idea....is there a way I can do this on a single line ??
any help would... (2 Replies)
Hi
Does anybody know how I can check if a file exists on a remote machine
i.e. see bellow, this doesn't work by the way and if tried countless variations on this
#!/bin/sh
hostname=server56
if ; then
echo file exists
else
echo file doesn't exist
fi
Any help on this would... (2 Replies)
Hello,
I have a script that uploads a file from local to remote place using ftp. The problem is that, if on remote host there is a file called the same as the one I want to upload, the ftp program overrides that file. But I don't want to override nothing (even if the remote file is older,... (3 Replies)
I am haveing one script haveing one issue with this could any one can reply soon it is very urgent.
:p
if ssh hcp_ftp@$1 'ls '$2/stop.txt' 1>&2 2>/dev/null'; then exit 1;
else
scp -p hcp_ftp@$1:$2/VAT*.dat $3 <<EOF
EOF
cd $3
pwd
echo 'About to find file'
SOURCE_FILE=$(ls -rt VAT*.dat|tail... (2 Replies)
I've seen this question posed a few times with shell scripting, but have not found anything with csh. I am trying to download multiple txt files from a source using wget. These are archived tornado warning files; however, the files only exist if there were tornado warnings issued that day. I'm... (3 Replies)
Hi, I'm pretty new to kernel coding and I'm working on a device driver that works with an existing framework.
Basically my module will be loaded/unloaded multiple times and I'd like to create a register a class, driver, and create a /dev node on the first load only. The existing framework... (0 Replies)
Hi everyone,
I am trying to figure out a way to ssh to remote server and check if file exists, and if it doesn't I want to leave the script with an exit status of 5.
I have the following that I am attempting to use, but it is not returning anything:
check()
{
ssh ${SOURCE_SERV} "ls -l... (4 Replies)
Hi,
I need to check if a file exists on remote server using expect.
#!/bin/bash
ip_addr=10.10.10.10
user=root
passwd=Help
filename=/root/test
expect -c "
spawn ssh -n -T -o NumberOfPasswordPrompts=3 -o StrictHostKeyChecking=no $user@$ip_addr
expect \"*?assword:*\"
send --... (6 Replies)
Hi there,
I am sorry to ask that kind of beginner thing, but all the code I found online didnt work for me.
All I want to do is: Check via SSH if a File exists on my webserver. The SSH login has to be with username and password.
So I would be very thankful if somebody could write the line.... (8 Replies)
Discussion started by: Jens885544
8 Replies
LEARN ABOUT ULTRIX
userfile
USERFILE(5) File Formats Manual USERFILE(5)Name
USERFILE - defines uucp security
Syntax
/usr/lib/uucp/USERFILE
Description
The utility uses the USERFILE to establish what access a remote system can have to the local system. An entry should exist for each sys-
tem. If no entries exist for a particular system, the default entries are used. The entries for particular systems have the following
format:
login-name , node-name X # path-name
login-name
The name with which the remote system logs in.
node-name The name of the remote node.
X# The execution level for the remote system. The remote system can execute commands defined in the file that have an execution
level less than or equal to the number #.
path-name The remote system can access anything at the local system with this prefix.
Two entries must also be provided for systems not otherwise listed:
remote, X# path-name ...
local, X# path-name ...
These entries define the execution level and access pathnames for the local system and all remote systems not defined by specific entries.
Examples
remote, X1 /usr/spool/uucppublic
local, X9 /
max,systemY /usr/sources /usr/src/share
max,systemZ X3 /usr
In the above example, the node named systemY with the login name max has access to anything with the pathname prefixes and The node named
systemZ with the login name max can execute commands defined in with an execution level of 3 or lower. It can access anything with the
pathname prefix
Any other remote systems can execute commands defined in with an execution level of 1 or 0. They can access anything with the pathname
prefix of
Users on the local system can execute any of the commands defined in and access anything on the system.
See Also
Guide to the uucp Utility
USERFILE(5)