Very odd... When I tested this out on Jan 15th it worked just fine... I try to run it today and I get the following error:
scp: ambiguous target
When I check the cmd it appears to be adding a : to the end of the line / filename
I am getting the following:
/path/filename: No such file or directory
My current script is :
Code:
#!/bin/bash
set -x
OLDIFS=$IFS
IFS=":"
while read server filepath
do
scp -t "$server:$filepath" $server${filepath//\//_}
done < new.list
IFS=$OLDIFS
Hi All,
I want to rename set of files in the remote server which iam unable to do . i can rename only one file
at a time . for example
ftp $REMOTESERVER
{
rename $NAME1 $NAME2
} is working
whereas
ftp $REMOTESERVER
{
rename $NAME1*.dat $NAME2*.data
} is not working ...... (4 Replies)
Hi All,
what is the comand to log off the remote server?
I have 2 servers A, B. I need to find all files older than 7 days on server B and copy over to server A. My logic is:
login the remote server:
=================
ssh hostB
cd /data/test
find . -mtime -7 -ls | awk '{print... (4 Replies)
Hi Friends,
Could you please help me as per my requirement mentioned below ?
I have to copy files from one unix server to another unix server, and the files that i need to copy from the remote server are only those which are modified/created Today from abc directory on the remote server (1 Reply)
Hi All,
In make file i want to include header files from my local directory and if it did not find in local directory i want to include from network directory. can any help me how i can do this?.
here is the code
INCLUDE=${include}/
this is point to network dir how i can add option that it... (1 Reply)
Hi there,
I have a problem in my script,
I need to check whether file exists in remote server or not,
if the file exists, then stop copy
else copy the file to the server..
my code is something like this
while read $server
do
if ssh $server "cd $directory_name; if ; then echo "Error:... (2 Replies)
Hi experts,
I 'm newbie to unix world, now I have task to copy the latest files from remote server to my local. I believe this must be very common request in this community. I want you do it one more time for me please.
My requirement is something like this:
I receive files in the below... (3 Replies)
Hello.
I use this command :
rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command.
And no full source directories are in use, only some files.
Source example... (2 Replies)
I want to rename (move) multiple files on remote server. I tried the following command to move all TXT files from my_dir directory to /new_dir. But it does not work. Any help?
#!/bin/ksh
sftp -dev3 << ABC
cd my_dir
$(for i in TXT; do echo "ls *.$i" ; rename $x /new_dir/$x;... (1 Reply)
Discussion started by: Soham
1 Replies
LEARN ABOUT HPUX
dtdtsdatatodatatype
DtDtsDataToDataType(library call) DtDtsDataToDataType(library call)
NAME
DtDtsDataToDataType -- get the data type for a set of data
SYNOPSIS
#include <Dt/Dts.h>
char *DtDtsDataToDataType(
const char *filepath,
const void *buffer,
const int size,
const struct stat *stat_buff,
const char *link_path,
const struct stat *link_stat_buff,
const char *opt_name);
DESCRIPTION
The DtDtsDataToDataType function determines the data type of a set of data, based on the information given in the non- NULL pointer argu-
ments to the function. The function gathers any additional information, if it is needed, to compensate for the NULL arguments. For exam-
ple, if the filepath argument is given, but the stat_buff argument is NULL and a stat_buff value is required to determine the data type,
DtDtsDataToDataType calls the stat(2) function to obtain the information.
The filepath argument is the pathname of a file.
The buffer argument is a pointer to the buffer of the data to be typed.
The size argument is the size of the buffer in bytes.
The stat_buff argument is the buffer returned from a stat(2) or fstat(3) call for use in typing.
The link_path argument is the pathname of the target file pointed to by a symbolic link.
The link_stat_buff argument is the buffer returned from an lstat(2) call for use in typing.
The opt_name argument can be used to specify a name to be associated with the buffer. If the opt_name argument is not NULL, it is used as
a pseudo file name in typing; otherwise, certain attributes may be returned as NULL because the filename components could not be deter-
mined.
RETURN VALUE
Upon successful completion, the DtDtsDataToDataType function returns a pointer to a data type string, or NULL if no value could be deter-
mined.
APPLICATION USAGE
The DtDtsDataToDataType function is generally used by applications such as file managers to improve performance. Typical applications
should probably use DtDtsFileToDataType(3) or DtDtsBufferToDataType(3) instead.
The DtDtsBuffer* functions assume that the buffer is readable and writable by the user, group and other file classes and select a type
accordingly. An application requiring a type based on read-only permissions should use DtDtsDataToDataType with a stat_buff value created
for this purpose: all fields should NULL except for the st_mode field, which should be set to:
S_IFREG | S_IROTH | S_IRGRP | S_IRUSR
SEE ALSO
Dt/Dts.h, DtDtsLoadDataTypes(3), DtDtsFileToDataType(3), DtDtsBufferToDataType(3), fstat(3), lstat(2), stat(2).
DtDtsDataToDataType(library call)