Search Results

Search: Posts Made By: mohca2020
1,226
Posted By mohca2020
Thanks. But in the for loop, I am using the...
Thanks.

But in the for loop, I am using the SERVER var:

for SERVER in $(cat ${SERVERFILE})
do
#${SSH_COMMAND} ---> Not working
#ssh -o ConnectTimeout=2 ${SERVER}...
1,226
Posted By mohca2020
Assign a command to a variable - Help
Hi,

I have the script below. When i assign SSH_COMMAND to "ssh -o ConnectTimeout=2 ${SERVER} ${AS_SUDO} ${COMMANDS}" and then execute it as ${SSH_COMMAND} I get the following error:

ssh: Could...
1,232
Posted By mohca2020
Perfect. Retested it and it's working as...
Perfect. Retested it and it's working as expected.

Thanks
1,232
Posted By mohca2020
Getopts not echoing correctly
Hi,

When I run the the following code:

#!/bin/bash


if [[ ${#} -lt 1 ]]; then
usage
fi

if [[ ${UID} -eq 0 ]]
then
echo "Do not execute this as root, use -s instead"
fi
...
18,161
Posted By mohca2020
What do you mean before the set. How does set...
What do you mean before the set. How does set change $1 and $2?
18,161
Posted By mohca2020
Thanks for the information. So when I run the...
Thanks for the information. So when I run the script:
./script.sh -r test the -- "$@" assigns "-r" to $1 and "test" to $2?
18,161
Posted By mohca2020
Eval set -- and more
Hello everyone,

I am taking a course on Lynda and they show this code below. I didn't fully understand some parts. Please see the questions within the code.

Thank you for your input and time.
...
1,863
Posted By mohca2020
Thank you so much. I wish there is an online...
Thank you so much. I wish there is an online tutorial for running SQL scripts from Bash. I found some but the explanation is not clear or detailed.

Let me know if you know any.

Regards,
1,863
Posted By mohca2020
Very clear thank you so much. Q2: for echo...
Very clear thank you so much.
Q2: for echo "exit" | sqlplus ....

Where does the "exit" go or how is it being used?
1,863
Posted By mohca2020
Oooh, okay I get it. So if the string "Connected...
Oooh, okay I get it. So if the string "Connected to: " is found, grep will give 0 for true and 1 for false (which means not found). Then if [ $? -eq 0 ] tests against the true or false values of...
1,863
Posted By mohca2020
Question 1: So I guess when the connection fails,...
Question 1: So I guess when the connection fails, there will be some error messages which will make if [ $? -eq 0 ] evaluate to false, correct? But if there are error messages or any output from...
1,863
Posted By mohca2020
Sqlplus code format
Hi,

I have some questions about sqlplus running from bash. I am still new and learning. I have the code shown below:

echo "exit" | sqlplus...
Showing results 1 to 12 of 12

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