Search Results

Search: Posts Made By: OdedOvdat
1,782
Posted By OdedOvdat
[Help] Adding text to a variable line in a file
Hey guys,
I need to write a script that will add a specific text at the end of a specific line (of a text file). but the line is a variable
this is my text file :
device_2...
12,442
Posted By OdedOvdat
Works great thanks guys
Works great
thanks guys
1,699
Posted By OdedOvdat
I don't need to restart the SSH service I just...
I don't need to restart the SSH service
I just need to restart the SSH process so it will run with the latest configuration

the old SSH script looks like this:
ssh -Nf -i id_logs -R...
1,699
Posted By OdedOvdat
Remotely close & rerun SSH connection
I'm trying to remotely run an upgrade script (via SSH) that update the SSH script on several hosts, just need to add several flags for the ssh command to look like this:

ssh -Nf -i id_logs -o...
12,442
Posted By OdedOvdat
Script that tries to connect via SSH till connection is up
Hey,

I need a script that tries to connect via SSH to a remote server
and that remote server might not be up yet, so retry until succeed
the error message I get if the server is not up yet is:...
1,474
Posted By OdedOvdat
I found a working script NEW_PORT=$(sed -n...
I found a working script

NEW_PORT=$(sed -n 's/^.*\-R\s\([0-9]*\)\:.*/\1/p' file1)
sed -i s/__PORT__/$NEW_PORT/g file2

@yoda thanks for your help
1,474
Posted By OdedOvdat
It seems its not working file1 = 30002 ...
It seems its not working

file1 = 30002
file2 = __PORT__

@Yoda any idea why ?
1,474
Posted By OdedOvdat
I did try both scripts but the port in the...
I did try both scripts
but the port in the second file (__PORT__) is not being replaced to "30002"

file1 is the file with 30002
file2 is the file with __PORT__
1,474
Posted By OdedOvdat
No I want to replace the __PORT__ of the first...
No
I want to replace the __PORT__ of the first file
with 30002 from the second file

so both files will have the same port (30002)
1,474
Posted By OdedOvdat
Sorry for not using code tags, still new here ...
Sorry for not using code tags, still new here

I tried running both of them but its not replacing 30002 with the __PORT__

any idea maybe ?
1,474
Posted By OdedOvdat
How to get 1 word from 1 file and print to another file?
Hey
I have 2 scripts, first one with this line:

ssh -Nf -i id_logs -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=5 -R 30002:127.0.0.1:22 user@hostname

the second...
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 06:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy