10-20-2008
help with this code
Hi everyone, I am new to this site, and i would like some help with this:
#! /bin/ksh -
# copies files to more tham one server
# Names of the servers must be in a file called server.txt
x=0 //varible for the loop
while [$x -eq 0] //repits loop until finds out if the file in $FILES
do //exists
echo "Source file?" //
read FILES //lread the file from keybord and saves it in $FILE
ls $FILES // executes ls with $FILES
if [$? -eq 0] //if the file existes switches x=0 to x =1
then //to close the loop
x=1
fi
done
echo "Choose destination"
read FILED
for i in `cat server.txt`
do
scp $FILES user@$i:$FILED;
done
this is a script that I want to use to copy files to diferent servers (AIX & linux). If I skip the while the scripts runs, but I also wants the script to check if the file entered by keyboard exists, but i get an error ksh:[o : not found.
If anyone can help, I´ll very happy.
pd: I am new to Unix, if I am making a terrible naife error, please forgive
thanks a lot
6 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi Guys,
I was just wondering if anybody can help me with this problem.
OK, how we can get a value back from PL/SQL Script (not stored procedure/function)
See the below example: (for example aaa.sh)
#!/bin/ksh
VALUE=`sqlplus -s user/password@test_id <<EOF
@xxx.sq
EOF`
echo $VALUE
... (7 Replies)
Discussion started by: Shaz
7 Replies
2. Programming
helo my protocol format is given below
{ destno,mode,no.of packet,pktsize,,pktno,textsize,CRC}
description:- { is starting flag
destno - 4bytes
mode - 1 byte
no.of pkt - 4byes
pktsize - 6 bytes
... (1 Reply)
Discussion started by: amitpansuria
1 Replies
3. Shell Programming and Scripting
hi all,
Can any 1 help me translate this korn shell code to C shell code :
email=$(grep "^$1" $folder/config_2.txt | awk '{print $2'})
In config_2.txt the content is :
which mean in korn shell , $1=groupname and $2=email address.
Now i need to write in C shell script,when i set the... (2 Replies)
Discussion started by: proghack
2 Replies
4. UNIX for Dummies Questions & Answers
01,011600033,011600033,110516,0834,2,90,,2/
02,011600033,011103093,1,110317,0834,,2/
03,105581,,015,+00000416418,,,901,+00000000148,,,922,+000000
00354,,/
03,113806,,015,+00000559618,,,901,+00000000096,,,922,+000000
00621,,/
88,902,+0000000025218,,/... (1 Reply)
Discussion started by: sgoud
1 Replies
5. Shell Programming and Scripting
Hi,
I want to remove the following code from Source files (or replace the code with empty.) from all the source files in given directory.
finally {
if (null != hibernateSession && hibernateSession.isOpen()) {
//hibernateSession.close();
}
}
It would be great if the script has... (2 Replies)
Discussion started by: hareeshram
2 Replies
6. Linux
Hi ,
I have a code where i am using a infinite while loop . some thing like below
while
do
if
then
#go to line 20
fi
command 1;
command 2;
#line 20:
sleep 34; (5 Replies)
Discussion started by: Paarth
5 Replies
XFSINFO(1) General Commands Manual XFSINFO(1)
NAME
xfsinfo - X font server information utility
SYNOPSIS
xfsinfo [-server servername]
DESCRIPTION
Xfsinfo is a utility for displaying information about an X font server. It is used to examine the capabilities of a server, the predefined
values for various parameters used in communicating between clients and the server, and the font catalogues and alternate servers that are
available.
OPTIONS
-server servername
This option specifies the X font server to contact. servername must be specified in one of the formats defined in the Font Server
Names section of X(7). If not specified, the server name in the FONTSERVER environment variable is used.
HISTORY
Xfsinfo was originally called fsinfo. It was renamed to avoid a clash with the fsinfo utility from the Berkeley automounter amd.
EXAMPLE
The following shows a sample produced by xfsinfo.
example% xfsinfo -server hansen:7100
name of server: hansen:7100
version number: 1
vendor string: Font Server Prototype
vendor release number: 17
maximum request size: 16384 longwords (65536 bytes)
number of catalogues: 1
all
Number of alternate servers: 2
#0 hansen:7101
#1 hansen:7102
number of extensions: 0
ENVIRONMENT
FONTSERVER
To get the default fontserver. The server name must be specified in one of the formats defined in the Font Server Names section of
X(7).
SEE ALSO
xfs(1), fslsfonts(1), X(7).
AUTHOR
Dave Lemke, Network Computing Devices, Inc
X Version 11 xfsinfo 1.0.3 XFSINFO(1)