Thank you @RudiC for the reply! Very much appreciate you taking the time to review my post. I will also look into using the case statement to clean up the code readability!
For this code suggestion, I would like to clarify a few things.
Could I still use sshpass when connecting and could I use the $InputIP from the input file? So would your code suggestion look like the following:
Secondly...each command instruction, I would like to assign a variable to each. Would I be able to do that as follows based on your code suggestion:
The reason I would like to assign variables to each result is so that I may place these into the final report where necessary.
Thanks!
Last edited by greavette; 09-17-2019 at 01:25 AM..
HI,
Can't seem to find anything on the forums to fix this.
I have a file, one line within this will not have a specific string at the end.
I have the string, but need to append it to the specific line which has it missing.
I need to use a variable for this, $string - I am using double... (13 Replies)
Hey guys, new problem....im not being able to seperate variables.
the code runs like this...
OPTIONS=$(awk '{print $2}' /etc/fstab}
a=$(zenity --list --text "Mount points selection" --radiolist --column "choice" --column "mountpt" FALSE $OPTIONS); echo $a
Note: the result i get is that... (2 Replies)
Hi there
I found the Command to send commands to other servers like:
sv01> ssh user@sv02 'ps -ef'
But I cant use Variables from a script i want to execute on another server like:
sv01> ssh user@sv02 'cd $SCRIPTHOME'
although the variable is set on sv01.
How can I run commands on sv02 with... (2 Replies)
Hi All,
I need to execute a SQL via shell script and i am connecting to Oracle DB by this way $USERNAME1/$PASSWORD1@$STRING1 and i need to get username, password and string from someother file stored in the Unix Directory. $Username, $Password and $String is stored in File A in Path A and i want... (1 Reply)
Requirement:
Run a shell script with below inputs
file name
checksum
path
the script should go to multiple servers (around 35) and verify the input cksum and if there is a mismatch display a simple message to the user that cksum verification failed.
host details, user id /... (1 Reply)
Hi,
I have script1.sh on 3 servers. I want to collect output report generated by them to a single server and append all the reports. Please tell me how can i do this? (2 Replies)
Hello,
I have access to several linux servers (mostly centos based) located in a DC in another country.
from day to day I need to login to each of them to do some work (they dont have gui/window manager installed, I work only from console), or even to just do a check like df -h for disc usage.... (3 Replies)
Hi,
I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step:
#!/bin/bash
# LAN SSH KEYS DISCOVERY SCRIPT
</etc/passwd \
grep /bin/bash |
cut -d: -f6 |
sudo xargs -i -- sh -c '
&& cat... (11 Replies)
Greetings Experts,
I am working for a bank client and have a question on connect-direct and SFTP.
We are using Linux RedHat servers. We use connect-direct to transfer (NDM) files from one server to another server. At times, we manually transfer the files using SFTP from one server to another... (2 Replies)
Discussion started by: chill3chee
2 Replies
LEARN ABOUT LINUX
uptime
UPTIME(1) Linux User's Manual UPTIME(1)NAME
uptime - Tell how long the system has been running.
SYNOPSIS
uptime
uptime [-V]
DESCRIPTION
uptime gives a one line display of the following information. The current time, how long the system has been running, how many users are
currently logged on, and the system load averages for the past 1, 5, and 15 minutes.
This is the same information contained in the header line displayed by w(1).
System load averages is the average number of processes that are either in a runnable or uninterruptable state. A process in a runnable
state is either using the CPU or waiting to use the CPU. A process in uninterruptable state is waiting for some I/O access, eg waiting for
disk. The averages are taken over the three time intervals. Load averages are not normalized for the number of CPUs in a system, so a
load average of 1 means a single CPU system is loaded all the time while on a 4 CPU system it means it was idle 75% of the time.
FILES
/var/run/utmp
information about who is currently logged on
/proc process information
AUTHORS
uptime was written by Larry Greenfield <greenfie@gauss.rutgers.edu> and Michael K. Johnson <johnsonm@sunsite.unc.edu>.
Please send bug reports to <albert@users.sf.net>
SEE ALSO ps(1), top(1), utmp(5), w(1)Cohesive Systems 26 Jan 1993 UPTIME(1)