Search Results

Search: Posts Made By: onenessboy
3,667
Posted By Don Cragun
The -gt can be read as "is greater...
The -gt can be read as "is greater than".
1,490
Posted By RavinderSingh13
Hello onenessboy, It is working fine for me...
Hello onenessboy,

It is working fine for me as follows. I am attaching screen shot for same too.
Since NOT able to copy/paste screen shot here.

Thanks,
R. Singh
1,490
Posted By RavinderSingh13
You could THANK people by hitting THANKS button...
You could THANK people by hitting THANKS button on left corner of each post. Could you please try following.


tac Input_file | awk 'FNR!=2 && FNR!=3' | tac


Let me know if this helps you.
...
1,490
Posted By RavinderSingh13
Hello onenessboy, Could you please try...
Hello onenessboy,

Could you please try following once.


tac Input_file | awk 'FNR==2{sub("static","dynamic")} FNR==3{sub("gnutls","ls")} 1' | tac


In case you want to save output into...
4,090
Posted By MadeInGermany
If the loop goes over the running processes, how...
If the loop goes over the running processes, how are the not running processes detected then?
The following loops over the files to get the DB instances, then looks them up in the ps output:
# turn...
4,090
Posted By MadeInGermany
You can also separate with a newline, and you can...
You can also separate with a newline, and you can use two -e options for sed, and I think you want to insert \ characters
escapedText=$(
echo "$text
$text1" | sed -e 's/"/\\"/g' -e "s/'/\\\\'/g"...
4,090
Posted By Don Cragun
Your code fragment: echo $text | $text1 is piping...
Your code fragment: echo $text | $text1 is piping the output from echo $text into the command specified by $text1. From your description, that doesn't seem to be what you want to do. If you had...
4,090
Posted By gull04
Hi, Instead of; escapedText=$(echo...
Hi,

Instead of;

escapedText=$(echo $text | $text1 | sed 's/"/\"/g' | sed "s/'/\'/g" )


Try;

escapedText=$(echo "$text $text1" | sed 's/"/\"/g' | sed "s/'/\'/g" )


Regards

Gull04
3,545
Posted By rbatte1
You don't add oracle to the wheel group. You...
You don't add oracle to the wheel group. You need to allow your account to execute as oracle. Say your account is bob, then the entry in /etc/sudoers (or perhaps under /etc/sudoers.d/* could be...
3,545
Posted By rbatte1
Just thinking about this in the wider question,...
Just thinking about this in the wider question, you might (on you local machine) have to do this:-ssh bob@server "sudo -u oracle /path/to/your/script".... or perhaps:-ssh -t bob@server "sudo -u...
5,411
Posted By RudiC
Sorry to have been imprecise - you should have...
Sorry to have been imprecise - you should have left KnownTime = T[1]
LastFile = $1where it was, just move the two lines (SUM & exit) into the if branch...
5,411
Posted By RudiC
Assuming the stat command on your system allows...
Assuming the stat command on your system allows for the -f (--file-system) option, and shamelessly stealing from Don Cragun's earlier post, and NOT being able to ultimately test this on my system,...
5,411
Posted By RudiC
PCT=0.4 defines the necessary free space... this...
PCT=0.4 defines the necessary free space... this minus the actually available space yields the files' sizes to be deleted.
5,411
Posted By Don Cragun
Hi onenessboy, You can start by showing us the...
Hi onenessboy,
You can start by showing us the complete, exact output produced by the command:df -P /backup
If the output from the above command doesn't complain about an unknown -P option, the...
5,411
Posted By RudiC
Talking about simplifying, why not ls -r1...
Talking about simplifying, why not


ls -r1 2[0-9][0-9][0-9][01][0-9][0-3][0-9]_[0-2][0-9][0-5][0-9].tar.gz | awk -F_ 'T[$1]++ {print "echo rm " $0}' | sh
5,411
Posted By RudiC
How about ls 2018* | sort -ur -k1,1 -t_ |...
How about


ls 2018* | sort -ur -k1,1 -t_ | cut -d_ -f1 | while read TS; do echo rm $(ls -r $TS* | tail -n +2); done
rm 20180721_0212.tar.gz 20180721_0112.tar.gz 20180721_0012.tar.gz
rm...
5,411
Posted By Don Cragun
I would be tempted to try a slightly simpler...
I would be tempted to try a slightly simpler pipeline for what RudiC suggested:
ls -1 2[0-9][0-9][0-9][01][0-9][0-3][0-9]_[0-2][0-9][0-5][0-9].tar.gz |
awk -F_ '
$1 == last {
print "echo rm "...
809
Posted By RudiC
A bit overcomplicated, no? A for loop for a...
A bit overcomplicated, no? A for loop for a single file, two sed invocations in lieu of one. . . Why not (untested)

sh /home/centos/du.sh | sed '1,124d; s/.$//' > /home/centos/abc.csv
3,731
Posted By stomp
Generally the way you try it is the way it works....
Generally the way you try it is the way it works.


What's the error message?

Did you try to run your command with increased verbosity? (ssh -v or even ssh -vv)

Btw.: You need your public...
809
Posted By apmcd47
Please use code tags. tail: du.sh | tail...
Please use code tags.

tail:
du.sh | tail -n +4
sed:
du.sh | sed '1,3d'
awk:
du.sh | awk 'NR>3'
There may be others.

Andrew
2,238
Posted By RudiC
Try awk '{for (i=1; i<=NF; i++) if ($i ~...
Try awk '{for (i=1; i<=NF; i++) if ($i ~ /system/) print $i}'.

EDIT: The struck through if was because I misread your spec to only contain system related tables...
866
Posted By RudiC
Try df -h / | awk ' {printf "%s, %s\n" ,...
Try

df -h / | awk ' {printf "%s, %s\n" , $2+0, $3+0}' and also start to use printf's format string correctly.
The second question I do not understand - what else could it display?
1,209
Posted By MadeInGermany
A for loop cycles over the script arguments by...
A for loop cycles over the script arguments by default:
bkp_name="bkp-$$"
data_dir="/var/lib/data/"
for keyspace
do
echo do something with "$keyspace"
done
Replace the echo command with the...
1,209
Posted By Corona688
Please use code tags. You got one bit...
Please use code tags.

You got one bit backwards, so your program ends up throwing away the first argument before you use it. Try reversing these two lines.

#!/bin/bash
echo "arg count = $#"
...
Showing results 1 to 24 of 24

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