Search Results

Search: Posts Made By: Optimus81
894
Posted By Aia
The whole line before pattern? ifconfig -a |...
The whole line before pattern?

ifconfig -a | awk '{a[++i]=$0;} /10.118.67.33/{print a[NR-1]}'
2,154
Posted By Don Cragun
What have you tried so far?
What have you tried so far?
7,265
Posted By Corona688
What have you tried? You cannot simply keep...
What have you tried?

You cannot simply keep asking us to write every bit of your script for you piece by piece...
7,265
Posted By MadeInGermany
You can omit the group here, or omit the user by...
You can omit the group here, or omit the user by setting the 2nd argument to ""
#!/bin/sh
set -f
startdir=$1
owner=$2
group=$3
[ -n "$startdir" ] && [ -n "$owner" -o -n "$group" ] || exec echo...
7,265
Posted By MadeInGermany
You mean, list either wrong given owner or wrong...
You mean, list either wrong given owner or wrong given group?
Then it's this one:
#!/bin/sh
startdir=$1
owner=$2
group=$3
[ -n "$startdir" -a -n "$owner" -a -n "$group" ] || exec echo 'need...
7,265
Posted By MadeInGermany
With find (recursive!) #!/bin/sh startdir=$1 ...
With find (recursive!)
#!/bin/sh
startdir=$1
owner=$2
[ -n "$startdir" -a -n "$owner" ] || exit
find "$startdir" \! -user "$owner" -exec ls -ld {} + | awk '{print $1, $3, $4, $9}'
# or
#find...
4,728
Posted By Yoda
You can use below option to avoid that prompt: ...
You can use below option to avoid that prompt:
-o StrictHostKeyChecking=no
7,356
Posted By ahamed101
awk 'BEGIN{a="|";b="="} function...
awk 'BEGIN{a="|";b="="}
function prt_hdr_ftr(val){
printf a; for(i=0;i<=50;i++)printf b;print a
}
function prt_data(){
for(i in data) printf "%-s %-25s%-10s%16s\n",a,i,data[i],a
}
/Checking...
7,356
Posted By Yoda
You got yourself a Useless Use of Cat Award...
You got yourself a Useless Use of Cat Award (http://partmaps.org/era/unix/award.html#cat)

Please note that the purpose of cat is to concatenate file, there is no need to cat a file and pipe the...
7,356
Posted By Yoda
Here is an awk program: awk ' BEGIN {...
Here is an awk program:
awk '
BEGIN {
print "|===============================================|"
print "| R E P O R T S T A T U S |"
...
10,522
Posted By DGPickett
Adding color is tricky, because the position of...
Adding color is tricky, because the position of the gutter is dynamically determined. If you knew what is was and the escape sequences for your $TERM (which is color capable) then it is just a bit...
1,908
Posted By anbu23
Use Tee command to send output to console and...
Use Tee command to send output to console and file

nawk 'BEGIN {CmpAr["VerifyInterface"]=2 # some definitions
CmpAr["CoreFileGenerated"]=3
...
3,027
Posted By RudiC
I'm not sure I understand. You said you wanted to...
I'm not sure I understand. You said you wanted to exclude the header file and run the awk program on one log file at a time within a shell script. OK, fine with me. Now you say, you nevertheless want...
3,027
Posted By Yoda
echo echo "Server Interface Checks...
echo
echo "Server Interface Checks Process Checks Service Check"
echo " VerifyInterface Corefile VerifyRegister VerifyComponent ...
1,371
Posted By radoulov
Try this: nawk 'BEGIN { print...
Try this:

nawk 'BEGIN {
print "|========================================|"
print "| SI No CHECKS STATUS |"
print...
1,371
Posted By radoulov
I would put the code inside the awk script: ...
I would put the code inside the awk script:

nawk 'BEGIN {
print "|========================================|"
print "| SI No CHECKS STATUS |"
print...
2,041
Posted By Franklin52
awk -F"." '/[Pp]assed/{print $1 FS}'...
awk -F"." '/[Pp]assed/{print $1 FS}' file
4,223
Posted By Yoda
awk 'BEGIN { print...
awk 'BEGIN {
print "|========================================|"
print "| Consolidated Report Status |"
print "|========================================|"
...
10,979
Posted By Chubler_XL
Use: log=$(basename "$dest" .cnf)_result.txt ...
Use:
log=$(basename "$dest" .cnf)_result.txt

for 2 you could do this:
[ -d /tmp/Config/output ] && mv /tmp/Config/output /tmp/Config/output_$(date +%Y%M%d%H%M)
mkdir -p /tmp/Config/output
10,979
Posted By Chubler_XL
One solution is to pipe the find output to a read...
One solution is to pipe the find output to a read loop and process pathname within loop:

find /src_path/to/ -iname '*.cnf' -print | while read src
do
dest=$(dirname "$src" | sed 's:.*/::')
...
4,324
Posted By Yoda
Use -e option with echo command to enable...
Use -e option with echo command to enable interpretation of the backslash-escaped characters.

RudiC mentioned in earlier post that diff commands syncs input lines. So I recommend using it to...
Showing results 1 to 21 of 21

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