I am trying to create a script where I am checking the process is being run by the correct user, when I go to run the script it is not returning what I am expecting and I am not 100% sure why!!!
First off I have determined what the process user should be at the top of the script
Then I have ran the process as I would normally in the command line
- An example below on the return from that:
I have then wrote my script saying if the em_process_user = enterprise_manager_user then do this if not do this. I am expecting it to return as root but as determined at the top of the script I have said enterprise_manager_user should = user casupport so should alert however it doesn't
When I execute the script it comes with the following:
Surely it should come back as 1?
Have you considered using pgrep?
Assuming that Introscope_Enterprise_Manager.lax is the name of the process you are looking for, the first pgrep will return all PIDs of those processes being run by the required user, while the second one will return all PIDs not being run by that user.
I have a script that does an SSH into a remote node. It should expect the prompt and send the password.
#!/usr/bin/expect
set user ;
set pass ;
spawn ssh $user@E-Internal
expect {
-re "RSA key fingerprint" {send "yes\r"}
timeout... (1 Reply)
I have a simple Expect script to power a system on and off in an endless loop looking for an ERROR message at which point the script should exit. But I need to skip the first 60 seconds after each power on or off and not exit if there are ERROR messages during that time. I thought I could use... (0 Replies)
My problem in brief is that I execute a script from another script and I can not pick up the return code from that script, or otherwise I am not returning from that script. I have an echo in the executed script and we get a response code of 0 and exit that script with the return code. I then try to... (1 Reply)
hello i write a script which calculate free space but he always is 0 thats wrong with my script?
getFileSystemPerformanceData()
{
if ; then
if grep -q "Ubuntu" /etc/issue ; then
CMD="df -lP | grep -v "\/home" | grep -v "\/dev/mapper/VolGroup-lv_root""
elif grep... (5 Replies)
Found myself stuck on this seemingly trivial issue. I have this script which call other shell files to do their deeds. The shell files in turn call some other programs as well. My problem is that in two of these shell files, the control doesnt return to next command in script unless the Enter key... (2 Replies)
Hi
Please take a look below, I'm grepping for /app/oracle and would like explicitly that result and not /app/oracle/admin as well.
# cat /tmp/fs.list
/app/oracle
/app/oracle/admin
# cat /tmp/fs.list | grep -w "/app/oracle"
/app/oracle
/app/oracle/admin (3 Replies)
hi all
plese clarify me in the following area.
1. What is the default NFS version in solaris 5.10. If it is 3, then why it asks me to specify "-o vers=3" keyword while i am mounting a share from a RHEL 5.1 Server?
2. Can someone give the link to download packages for accessing "ntfs"... (4 Replies)
Hi. I'm trying to call a script named checkForFile.sh from within my main script named master.sh. In checkForFile.sh I want to set a value to the variable fileExist, but then I want to reference the value in the master.sh script. Whenever I attempt this the echo statement is just blank.
... (5 Replies)
Hi everybody,
I have a script in which I'm invoking another script which runs in a subshell.
after the script is executed I want to return to the parent shell as some variables are set. However i'm unable to return to my original shell as the script which i'm calling inside is invoked in... (5 Replies)
Dear all,
When i ask a question in my script if the answer is not correct i need to goback to the begning of the script and ask the question again.
ex - What is your name ?
saman
Name is not correct ...try again
What is the name ?
Nimal
Thank you.... (2 Replies)