The solution works great! Out of curiosity, I wonder is there a way to accomplish the same thing with break/continue even though it is not as efficient?
Hi all experts,
here is a problem which i would appreciate ur expertise.
I need to do this:
Eg.
Find a number: 1234567 which i dunno which file and which folder
I do know which main folder it is in but it is hidden deep within a lot of subdir.
Is it possible to find the file? + output... (4 Replies)
Here is the file named tuwork..........
209 200 WZ 6529 SKTNCA01X4X C POI LODI LODI 738 SKTNCA0127T LOD
Here is the scipt.......
cat tuwork |
while
read rva
do
num=`echo $rva | cut -d" " -f1-2`
reg=`echo $rva | cut -c10`
ocn=`echo $rva | cut -c12-15`
x=`echo $rva | cut -c29`... (3 Replies)
I was just wondering how you would echo out different length variables but still have them all line up. I tried putting tabs between the variables but that didn't work as planned.
For example this is in some loop, with different variables in it each time:
echo "$1 $2 $3 $4 $5"
Appears like... (3 Replies)
hi:
I have some files like this
folder1/recording1.mp3
folder1/docs/budget.doc
folder2/others/misc.mp3
folder3/others/notes.doc
all this folders and files are under the mp3 folder.
I would like to move just the mp3s to another folder but retain the subdir structure i have.
So if... (4 Replies)
Hi,
I m trying to have script to grep a pattern in all files under a directory. I use Sun Solaris, the below want doesnt do exactly what I want.
find /home/xxx/ tagHeu | while read FILE; do
grep text $FILE && echo 1
grep text $FILE || echo 0
done
I also tried running:
find... (2 Replies)
I have created a directory structure and under the directory subdirectories and files are there.I need to move the entire thing
to another path.How can i write a script to do that.
currently the path of files is as below :
/data1/serial/mcycle/archive : under this path differnt sub dir exist ... (6 Replies)
Hey,
How can I copy files from subdirectories without copy the subdir
and copy it to a higher dir
For example:
/home/test/subdir/file1
copy file1 to /home or another dir
thanx (11 Replies)
Hi All,
I want to copy the dir/subdir structure from SERVER-A to SERVER-B without copying all the files in each dir.
Is it possible using SCP / SFTP command?
For example,
SERVER-A has following two dir/subdirectories and files under each subdir.
... (1 Reply)
I know, sounds mutually exclusive :-)
I have a script where I ask for a password and store it in a variable, and then use it with sudo on an array of other hosts. The password winds up being choed back to my terminal as well as to the process on the remote host, like:
Attempting to update... (2 Replies)
Hi,
When I run the the following code:
#!/bin/bash
if ]; then
usage
fi
if ]
then
echo "Do not execute this as root, use -s instead"
fi
SERVERFILE="servers"
function usage {
echo "USAGE: ${0} COMMAND" (4 Replies)
Discussion started by: mohca2020
4 Replies
LEARN ABOUT PHP
ssh2_methods_negotiated
SSH2_METHODS_NEGOTIATED(3) 1 SSH2_METHODS_NEGOTIATED(3)ssh2_methods_negotiated - Return list of negotiated methodsSYNOPSIS
array ssh2_methods_negotiated (resource $session)
DESCRIPTION
Returns list of negotiated methods.
PARAMETERS
o $session
- An SSH connection link identifier, obtained from a call to ssh2_connect(3).
RETURN VALUES EXAMPLES
Example #1
Determining what methods were negotiated
<?php
$connection = ssh2_connect('shell.example.com', 22);
$methods = ssh2_methods_negotiated($connection);
echo "Encryption keys were negotiated using: {$methods['kex']}
";
echo "Server identified using an {$methods['hostkey']} with ";
echo "fingerprint: " . ssh2_fingerprint($connection) . "
";
echo "Client to Server packets will use methods:
";
echo " Crypt: {$methods['client_to_server']['crypt']}
";
echo " Comp: {$methods['client_to_server']['comp']}
";
echo " MAC: {$methods['client_to_server']['mac']}
";
echo "Server to Client packets will use methods:
";
echo " Crypt: {$methods['server_to_client']['crypt']}
";
echo " Comp: {$methods['server_to_client']['comp']}
";
echo " MAC: {$methods['server_to_client']['mac']}
";
?>
SEE ALSO ssh2_connect(3).
PHP Documentation Group SSH2_METHODS_NEGOTIATED(3)