Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: Chubler_XL
2,682
Posted By RudiC
Shouldn't that be read user_name ...
Shouldn't that be
read user_name # no "$", no expansion
if grep $user_name /etc/passwd; then ... # no "[" (test) command, no "command substitution" - use grep's exit...
Forum: Linux 02-16-2020
3,038
Posted By Neo
Dear Veeresham, I think you may have...
Dear Veeresham,

I think you may have completely missed the point in my first post. MadeInGermany obviously did as well.

Let's take the price of this RAM on AliExpress:

Samsung server memory...
Forum: What is on Your Mind? 02-11-2020
4,713
Posted By Neo
Poster of the Year 2019 - Jeroen van Dijke
Today, I am very pleased to announce the Poster of the Year Award, 2019 is Jeroen van Dijke (Scrutinizer (https://www.unix.com/member_modal.php?u=302052697))

Jeroen has been a member of unix.com...
2,613
Posted By MadeInGermany
2&>1 creates a file named 1 in the current...
2&>1 creates a file named 1 in the current directory.
2>&1 is correct: it redirects descriptor 2 (stderr) to descriptor 1 (stdout). The & makes the following a file descriptor.
And the following |...
Forum: Solaris 12-19-2019
7,807
Posted By hicksd8
One thing for sure is that only one of the nodes...
One thing for sure is that only one of the nodes (Solaris 11 Global or Solaris 10 LDOM) can have control of the volume. In any situation, having two operating systems writing to a volume...
4,953
Posted By wisecracker
I am assuming you are using bash or perhaps a...
I am assuming you are using bash or perhaps a POSIX shell like dash.
Your error is telling you that it is not possible to do such a task as these shells have INTEGER arithmetic only.

If you need...
4,214
Posted By MadeInGermany
fgrep -v -x -f is more precise than grep -v -f...
fgrep -v -x -f is more precise than grep -v -f because it compares the full lines.
For ex bc should not match abc or bcd.
(A halfway approach would be grep -v -w -f that at least checks for word...
3,951
Posted By RudiC
Why not simplyinstalldir=${1//\\\\n/ }?
Why not simplyinstalldir=${1//\\\\n/ }?
3,902
Posted By MadeInGermany
You must give a facility.severity pair after -p ...
You must give a facility.severity pair after -p
For ex
logger -p user.err "XY 6990 - ERC API on $(hostname) is restarted"
The syslog service determines which file user.err is.
3,780
Posted By SDohmen
Converting XML to CSV
Hello,


For i while i have been using XMLStarlet to convert several XML files to CSV files. So far this always went fine.


Today however i got a new XML format however but i cannot find out...
1,836
Posted By balajesuri
I think OP is asking for side by side printing of...
I think OP is asking for side by side printing of the output of two python scripts as they run, and has shown as an example, concatenation of two text files using izip_longest().


@bigvito19...
7,375
Posted By Neo
Some say this is the reason that Apple ships with...
Some say this is the reason that Apple ships with an older version of bash:

Reference:

GNU General Public License - Wikipedia...
7,375
Posted By Corona688
BASH allows you to use the basic TTY properties...
BASH allows you to use the basic TTY properties to establish timeouts and read minimums:

#!/bin/bash

# Timeout is 1/10 of a second, minimum read is 0 characters
stty -icanon min 0 time 1
...
5,525
Posted By rohit_shinez
I completely agree with your approach which...
I completely agree with your approach which handles all type of scenarios. Thanks guys for your help
5,525
Posted By Corona688
#!/bin/bash MIN=1 MAX=10 STARS=0 ...
#!/bin/bash

MIN=1
MAX=10
STARS=0

S=$(printf '%*s' "$((MAX*2))" '')
D=${S// / *}

for ((N=MIN; N < (MAX*2); N++ && (STARS += W)))
do
[ "$N" -gt "$MAX" ] && W=$(((MAX*2)-N)) ||...
3,869
Posted By MadeInGermany
#/bin/bash if [ $# -eq 0 ] then echo...
#/bin/bash
if [ $# -eq 0 ]
then
echo "usage:
$0 procnames ..."
exit 1
fi
{
echo "#define PROCESS_COUNT $#"
printf "#define %s\n" "$@"
tail -n +3 "proc_hide.c"
} > hidelib.c
4,351
Posted By jcdole
Thank you very much. Nice demo. PS a...
Thank you very much.
Nice demo.


PS a dash is missing at the last line :
\) -o print
must be
\) -o -print
821
Posted By jim mcnamara
Chubler_XL - yes and no. One problem -...
Chubler_XL - yes and no.

One problem - lpstat -o reports data from the print queue acceptance time, not the mtime of a file. In other words, you could send a 10 year old file to a print queue...
876
Posted By rdrtx1
word=dominos KEYWORD=$(echo "$word" | awk '...
word=dominos

KEYWORD=$(echo "$word" | awk ' {
for (i=1; i<=length; i++)
printf "%s", substr($0, 1, a++) b substr($0, a+1) FS;
for (j=length; j>1; j--)
for (i=1; i<j; i++)
...
2,465
Posted By Scrutinizer
How about a concept like this, mutable without...
How about a concept like this, mutable without eval .. :
#!/usr/local/bin/dash
set -- a b c
array() {
_pos=$1
_newval=$2
_ARRAY= _i=-1 _val=
shift 2
for _val in "$@"
do
if [...
894
Posted By Don Cragun
Hi Chubler_XL, Your example works fine for the...
Hi Chubler_XL,
Your example works fine for the example you've chosen, but, as mattz40 mentioned in post #4 in this thread, it won't work if one or more of the filenames in the lists in the...
863
Posted By apmcd47
I've found this message...
I've found this message (http://lists.gnu.org/archive/html/bug-coreutils/2014-04/msg00015.html) in the bug-coreutils list. It turns out that date is parsing the + 1 as offset from UTC. This can be...
1,119
Posted By Don Cragun
This will work if you're using GNU awk. But,...
This will work if you're using GNU awk.

But, according to the standards, the results are unspecified if the value assigned to RS is more than one character. On most BSD- and UNIX-systems, awk...
1,240
Posted By MadeInGermany
Pardon? What is PGN? -- Another sed solution...
Pardon? What is PGN?
--
Another sed solution that will save some memory, by only reading the needed lines into the input buffer.
Written as a multi-liner (better readable):
sed '
:loop
/{/{
...
1,059
Posted By Corona688
As mentioned above, your MS Windows style text...
As mentioned above, your MS Windows style text file is full of carriage returns:

0000040 sp a n d sp O p e r a t o r cr nl G
6120 646e 4f20 6570 ...
Showing results 1 to 25 of 177

 

Featured Tech Videos

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