Search Results

Search: Posts Made By: mbak
4,685
Posted By mbak
Thank you for all the responses. I tested using...
Thank you for all the responses.
I tested using for loop which worked out well and ended up using backup_run $1 followed by backup_run $2 as I had to call function for each argument at 2 different...
4,685
Posted By mbak
Kindly excuse my first post. Here is my actual...
Kindly excuse my first post. Here is my actual script and I looked around to see if I could edit the first post. I'm trying to find how to pass 2 arguments to the script which in turn passes those 2...
4,685
Posted By mbak
Call same function using 2 different arguments
I have a script that uses 2 arguments. I want to call the function part within this script using these same arguments. Below is what I came up with below script so far, any guidance would be helpful....
1,085
Posted By mbak
Execute a script based on status of embedded script
Hi,
I have 2 scripts, first.ksh and second.ksh and would like first.ksh to run based on response of 'Y/y' received for second.ksh but in my case it continues to execute 'rm /tmp/list' irrespective...
813
Posted By mbak
Looking to minimize 'for' loops in script
Hi, Below is the script that I came up with but looking to see if there is a more appropriate way to achieve this by reducing number of "for" loops or something.

Regards,
mbak


#!/usr/bin/ksh...
1,870
Posted By mbak
Thanks to hicksd8 and Andrew for giving me couple...
Thanks to hicksd8 and Andrew for giving me couple of options to work with, much appreciated.
1,870
Posted By mbak
OS=AIX Basically, I'm just trying to trap the...
OS=AIX
Basically, I'm just trying to trap the error in the script and log it to ERR.OUT before mailing out ERR.OUT via mail command.
1,870
Posted By mbak
My apologies for missing out a value in the...
My apologies for missing out a value in the script, it should have been as below,

if grep -w $DISK1 NEWDISK.list | read VG DISK2 DISK3

Since I'm replacing multiple disks, I want to get an...
1,870
Posted By mbak
Notify as soon as an error is encountered in a script
Hi,

The script below works okay and emails me the log in the end once the script completes but what I'm trying to do is to also notify me via an email as soon as the script encounters any error...
2,586
Posted By mbak
I tried using the nohup option and for some...
I tried using the nohup option and for some reason it exits the script abruptly on the remote server but it works just fine with 'at' job and I'm also able to pass an argument on remote server with...
2,586
Posted By mbak
I'd like to pass 1 argument to the below code...
I'd like to pass 1 argument to the below code from a script called mail.sh that runs this code on remote server, any idea how to do it, I tried double quotes but it runs on the local server and also...
2,586
Posted By mbak
I ran using nohup and it works the same way as at...
I ran using nohup and it works the same way as at except that nohup sends the output to screen as well and I'd like set it up to receive an email only option to the user running the job rather than...
2,586
Posted By mbak
Thanks for suggesting to use && which does the...
Thanks for suggesting to use && which does the error check and I'd change the script name once it is complete as I need to add some more functionality.

The reason I prefer using at over nohup is...
2,586
Posted By mbak
I had to refrain from using 'exec' command as it...
I had to refrain from using 'exec' command as it abruptly ends my login session as soon as I run the command without giving any errors and also got rid of '&&'.
Btw..this is ksh on AIX OS.

Below...
2,586
Posted By mbak
I'm trying to execute the script and it just...
I'm trying to execute the script and it just kills my session at the end of execution.
2,586
Posted By mbak
Running a script on remote server kills my login session
Hi there,

I'm trying to run a script remotely on a server in a particular directory named after hostname which already exists, my login session gets killed as soon as I run the below command. Not...
1,338
Posted By mbak
Thanks for your suggestion to take a step back, ...
Thanks for your suggestion to take a step back,
here is the working code,

#!/bin/ksh
for i in $(lspv |grep hdisk | awk '{print $1}')
do
LIC=$(lscfg -vl $i |grep LIC | cut -d\. -f17)
...
1,338
Posted By mbak
My bad...I didn't realize about lspv and lscfg...
My bad...I didn't realize about lspv and lscfg outputs.

Here is the sample output of lspv and lscfg for reference
# lspv | awk '{print $1}'
hdisk0
hdisk1
hdisk2
hdisk3
hdisk4
hdisk5
hdisk6...
1,338
Posted By mbak
For loop not giving expected output
#cat /tmp/input
old_array old_dev new_dev new_array
0577 008AB 01744 0125
0577 008AC 01745 0125
0577 008AD 005C8 0125
0577 008AE 005C9 0125
0577 008AF 005CA...
1,691
Posted By mbak
Passing stdin value into a script that is called from another script
I'm trying to automatically pass user input values into a script that is being called from another script, below is my current script and I added a comment next to the script where it asks user to...
1,649
Posted By mbak
$ ./test.sh ++ date +%Y + year=2016 + for f...
$ ./test.sh
++ date +%Y
+ year=2016
+ for f in '/tmp/*.log'
+ cat /tmp/2016.log
cat: /tmp/2016.log: input file is output file
+ rm /tmp/2016.log
+ for f in '/tmp/*.log'
+ cat /tmp/aaa.log
+...
1,649
Posted By mbak
Aia - A belated thanks as I was away for sometime...
Aia - A belated thanks as I was away for sometime and didn't had a chance to look at the code, I'll post back if there are any issues.
1,649
Posted By mbak
Create file every year and log data to it
Hi there,
Here is what I currently have and trying to come up with a logic to automatically append logs to a respective year file. The log files might get generated everyday or any other day,...
8,052
Posted By mbak
This is what I was trying to achieve, Thank you...
This is what I was trying to achieve, Thank you so much for keeping it simple as well :)
8,052
Posted By mbak
I'm separating disks coming off a particular XIV...
I'm separating disks coming off a particular XIV storage array and redirecting output to /tmp/list.out as below

lsdev -Cc disk |grep 2810 |grep awk'{print$1}' > /tmp/list.out
and

cat...
Showing results 1 to 25 of 73

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