Search Results

Search: Posts Made By: capitanui
6,212
Posted By capitanui
Solved - Python Subprocess
Yeap, I saw it after all. Thanks
6,212
Posted By capitanui
Python subprocess
Hi guys,

I'm learning python and perl and i was trying to run from python a perl script using the subprocess module.
I have an issue that i don't understand regarding this.

I run this code:...
4,265
Posted By capitanui
For automating stuff like : backup logs, search...
For automating stuff like : backup logs, search for new warnings, verify files sequences etc i have most of the scripts made in bash.

I would like to go further in getting more knowledge, involvin...
4,265
Posted By capitanui
Learning project ideas - shell, python, UNIX tools, system administration
Hi guys,

I am currently working as a system administration engineer, administering telecom applications on linux/unix platforms.

I want to learn new things and improve the ones that i have and...
1,299
Posted By capitanui
Try: df -h | awk ' $1 ~ /rootvg/ {print $2,...
Try:

df -h | awk ' $1 ~ /rootvg/ {print $2, $5}' >> yourfile.txt
1,649
Posted By capitanui
Well it is quite a simple script. But i'm also a...
Well it is quite a simple script. But i'm also a begineer and I will explain it for you:

- First we declare a variable VAR that computes the number of processes running from the process listing(...
836
Posted By capitanui
It looks ok. One thing: After initiating the...
It looks ok. One thing:
After initiating the commands to stop the database, be sure to take the time until it has stopped. Sometimes it takes a little before the processes are killed and cleared.
...
1,649
Posted By capitanui
Your script should look something like this : ...
Your script should look something like this :

#!/bin/bash

#Get the number of processes containing etl running
VAR=`ps -ef | grep 'etl' | grep -v grep | wc -l`

#Verify if VAR >= 1
if [ $VAR...
8,616
Posted By capitanui
@Jotne You are right, thanks. I am also in a...
@Jotne
You are right, thanks. I am also in a learning phase!:)
8,616
Posted By capitanui
are you using AWK for this? if so you need...
are you using AWK for this?

if so you need to pass the variable into awk :

awk -v var="$wordToMatch" ' $0 ~ /var/ {printf("%s", "OK")}

Hope this helps you.
2,428
Posted By capitanui
awk 'gsub(/.../,"&\n",$2) {print "o/p:";print...
awk 'gsub(/.../,"&\n",$2) {print "o/p:";print $2}'

This will give you the output required. It's only available in this case.

Or this
awk 'BEGIN {print "o/p:"} gsub(/.../,"&\n",$2) {print $2}'
1,649
Posted By capitanui
ps - ef - lists processes grep test - print...
ps - ef - lists processes
grep test - print output lines that contain "test"
grep -v grep - excludes the "grep test" process you ran earlier from the list
2,157
Posted By capitanui
For awk i think you can use printf ("%s", $0) ...
For awk i think you can use printf ("%s", $0) instead of print $0

Hope it helps.
1,776
Posted By capitanui
grep -i "exception" /ops/opt/aaa/bvg.log | mail...
grep -i "exception" /ops/opt/aaa/bvg.log | mail -s "Exception occured" email@address.com


You can start from here.
Put in a script, add more logic to it then put it in a cron job to run every...
1,598
Posted By capitanui
The below will tell you if the files are...
The below will tell you if the files are different or not
cmp -s file1.txt file2.txt; echo $? | xargs -I var bash -c 'if [ var -gt 0 ];then echo "Files are different"; else echo "Files are the...
1,598
Posted By capitanui
Do you want to print the exact difference? or the...
Do you want to print the exact difference? or the lines that are different?
981
Posted By capitanui
Look at the small script below. Hope it helps ...
Look at the small script below. Hope it helps


#!/bin/bash
#Date
#Author
#Purpose : Alert on failed count > 0
#Usage : ./alertonfail.sh <file>

#File with the failed count
FILE=$1
...
2,075
Posted By capitanui
This is what i came with. If i correctly...
This is what i came with. If i correctly understood your question.

You have a file like :
PROCESS1 DATE=130813 TIME=130503 BATCHNO=0000000014
PROCESS1 DATE=130813 TIME=130503...
Showing results 1 to 18 of 18

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