Search Results

Search: Posts Made By: rbatte1
5,708
Posted By Chubler_XL
In general you would use VAR=$( command ) to...
In general you would use VAR=$( command ) to capture the output of each command and then echo your result at the end like this:

#!/bin/bash

if [ $# -eq 1 ]
then
filename="/home/marco/$1"...
7,867
Posted By nezabudka
Ok, The right time to learn how to use the...
Ok, The right time to learn how to use the '--debug' option?
sort -k3nr --debug <<<"Server1 not found 1025 MAJOR some info here"
sort: text ordering performed using simple byte comparison
sort:...
4,434
Posted By Peasant
You can untar without the actual copy to host : ...
You can untar without the actual copy to host :

ssh user@host "cd /existing_folder_you_wish_to_untar_to && tar -xvf -" < mytar.tar


Regards
Peasant.
11,181
Posted By sagar_1986
awk '/start/{flag=1} flag; /end/{flag=0}'...
awk '/start/{flag=1} flag; /end/{flag=0}' sample.txt awk '/start/,/123456/,/end/' sample.txt
sed '/start.*123456.*end/!d' sample.txt
sed -n '/start.*123456.*end/p' sample.txt
sed -e...
4,246
Posted By RudiC
Not sure this works with all tr versions: ...
Not sure this works with all tr versions:


echo "HiringManager_RHMC, DirectSupervisor_RHMC, ProcessServerReadAccess_ST" | tr -s ', ' '\n'
HiringManager_RHMC
DirectSupervisor_RHMC...
8,095
Posted By MadeInGermany
%06s is obviously not portable. On different OS...
%06s is obviously not portable.
On different OS I get different results:
printf "%06s\n" 01140
01140printf "%06s\n" 01140
001140However, never this is seen as a number.

--- Post updated at...
26,895
Posted By RudiC
You want the 3rd (...) newest file? Try NOT...
You want the 3rd (...) newest file? Try NOT reversing the sorting order
ls -lt *.conf | sed -n "${1}p"
7,617
Posted By Scrutinizer
Here are some more alternatives to try: Use...
Here are some more alternatives to try:

Use a here string
read var1 var2 <<< "$(openstack hypervisor stats show | awk -F'|' 'NR==14{print $2,$3}')"
Use a here document
read var1 var2 << EOB
...
7,617
Posted By Chubler_XL
the first < is a standard input redirection and...
the first < is a standard input redirection and causes input to the read command to come from a file.

The second part is process substitution witch takes the format of <(list). The value list...
Forum: What is on Your Mind? 01-24-2020
16,134
Posted By Neo
Moderators of the Year 2019 - Ravinder Singh and Victor Berridge
Today, I am very pleased to announce that the Moderator of the Year Award, 2019 has two very deserving winners.

Ravinder Singh (RavinderSingh13) and Victor Berridge (vbe)

Victor (vbe) has...
16,600
Posted By nezabudka
Hi You can use the -V option sort -V or...
Hi
You can use the -V option
sort -V
or even sort right away in a file
vim -nes +'%!sort -V' +wq file
6,990
Posted By RudiC
OK; give it a shot and report back the errors...
OK; give it a shot and report back the errors and/or shortfalls you encounter.
20,554
Posted By Peasant
I've seen this mostly related to DNS query...
I've seen this mostly related to DNS query timeouts setup from client side.
The defaults are quite high on most linux/unix operating system, from AIX man page online :


In practice if you have,...
5,340
Posted By vbe
This reminds me of silly situations I found...
This reminds me of silly situations I found myself from time to time... when a server goes wrong and at reboot, needs manual instruction to continue to boot, only when it happens it looses its...
16,752
Posted By MadeInGermany
[Tip] ptree for Linux
Unix (and Linux) uses a process tree that gives a natural security, by simple inheritance of attributes.

The following ptree script shows it. It runs on all Linux flavors.
Mostly useful for...
16,802
Posted By RudiC
Difficult to believe with unmodified input files....
Difficult to believe with unmodified input files. Pls report back your findings.


A regex using "alternation" as brought into play in rbatte1's post #4 will be the most efficient approach, as...
16,802
Posted By RudiC
Nice approach indeed! Could be curtailed to ...
Nice approach indeed!
Could be curtailed to
sed -r "/'($(paste -sd\| file2))'/s/^C//" file1, including the item list file as well.
Forum: What is on Your Mind? 01-01-2020
7,619
Posted By RavinderSingh13
Happy New Year 2020 to all :)
Hello All,

I would like to wish A very Happy New Year 2020 to all. May GOD bless all of us with TRUE knowledge, wisdom, great attitude, honesty, hard working capability, great health :b:

Cheers...
15,439
Posted By RudiC
A few comments allowed? The way you programmed...
A few comments allowed?
The way you programmed your script might not be the best use of resources:

for i in `cat file1` # useless use of cat, may fail on spaces in...
16,251
Posted By jim mcnamara
MicroFocus COBOL is your very best ORACLE option....
MicroFocus COBOL is your very best ORACLE option. It specializes in supporting ORACLE db's. It also is highly compatible with mainframe COBOL.
This will be the relatively easy part, moving code...
11,749
Posted By drl
Hi. All in a single perl code: extraction of...
Hi.

All in a single perl code: extraction of rightmost 2 digits, omit any containing lines greater than 33, numerically sort left-over lines based on right-most 2 characters:
#!/usr/bin/env perl...
9,597
Posted By MadeInGermany
Only match 443 or 9443, most simple as ERE (egrep...
Only match 443 or 9443, most simple as ERE (egrep or grep -E)
egrep '^Listen[[:blank:]]+9?443$'
Using a Posix character class rather than a GNU \s
7,519
Posted By Scrutinizer
Hi, the reason that the script is so slow, is...
Hi, the reason that the script is so slow, is that it is firing off 12 different sub shells per line in the input file, so that is 12 million sub shells in total, which is quite costly.
Examples of...
Forum: What is on Your Mind? 12-18-2019
41,845
Posted By Neo
UNIX.com End of Year (EOY) Report (2019)
Here is a quick EOY report for 2019.

2019 has been a year of "downward trend reversal" for UNIX.com. In fact, if we compare total Google search impressions from the peak days in December 2019...
5,404
Posted By Neo
I am closing this "cut and paste" spam of a...
I am closing this "cut and paste" spam of a question.

You can see from the post, the poster has just cut and posted from another web site into this one without taking the time to format his post...
Showing results 1 to 25 of 500

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