Search Results

Search: Posts Made By: MadeInGermany
137
Posted By MadeInGermany
Better have it in normal (double) quotes:...
Better have it in normal (double) quotes: "$n.pdf"
These let the shell expand the variable but deny other expansions.
Also have "$n.txt" (to deny other expansions).
195
Posted By MadeInGermany
In order to name a file with special characters,...
In order to name a file with special characters, ecape each special character with a \
The \ is a special character itself.
For the string "\?$*' (6 charcters) you enter \"\\\?\$\*\' (12...
595
Posted By MadeInGermany
The previous did not work for me. Perhaps...
The previous did not work for me.
Perhaps because of the mistake that a test buffer makes assumptions about the contents that can go wrong.
Better have a separate state variable (here: buffer_on)...
249
Posted By MadeInGermany
Does not work with all tr versions, because each...
Does not work with all tr versions, because each character,range,class in arg1 should match a character,range,class in arg2.
The following is portable:
echo "HiringManager_RHMC,...
302
Posted By MadeInGermany
I think you have ksh-88. You can augment your...
I think you have ksh-88.
You can augment your script(s) with a wrapper function (located somewhere at the beginning):
set_A(){
typeset varname=$1
shift
if [ "$BASH" ]
then
eval "$varname=(...
441
Posted By MadeInGermany
Perhaps you can set a default printer-queue with ...
Perhaps you can set a default printer-queue with
lpadmin -d "HPLJ4"?
I think you can list the current default with
lpstat -d
314
Posted By MadeInGermany
I think you expect rename -> prename as is the...
I think you expect rename -> prename as is the case on Debian. Another one with prename:
prename -n 's/^(CMRLPCR\d{6})_[^_]*/$1/' *.bumOr
prename -n 's/_[^_]*//' CMRLPCR??????_*.bum
The rename...
234
Posted By MadeInGermany
awk -F, 'a[$1]++==0' filenameis quick and dirty...
awk -F, 'a[$1]++==0' filenameis quick and dirty because it stores an unnecessary integer value.
The full and efficient code is
awk -F, '!($1 in a) { a[$1]; print }' filenameThat you can condense...
383
Posted By MadeInGermany
Attention, the standard shell and find glob has...
Attention, the standard shell and find glob has [!p] - [^p] is a GNU/libc extension.
(But the latter is standard in RegularExpression.)
601
Posted By MadeInGermany
Well, on the right side of > and < there can be a...
Well, on the right side of > and < there can be a filename, so the & prefix indicates it is a file descriptor.
On the left side it is clear that it's a file descriptor, so the bare number does it....
383
Posted By MadeInGermany
As I suggested, have -name "*.js?*" \! -name...
As I suggested, have -name "*.js?*" \! -name "*.jsp" or cheat with -name "*.js??*".
And most easy is of course -name "*.jsp?*".
383
Posted By MadeInGermany
(@Neo, nothing was really missing. I was able to...
(@Neo, nothing was really missing. I was able to construct the output from the given input sample and the given code. And no error message.)

The * in shell glob and find glob means every - even...
Forum: Linux 1 Week Ago
301
Posted By MadeInGermany
Let me predict what will happen without swap: ...
Let me predict what will happen without swap:
the machine will have spikes of high load, and during the spikes will pause its productive work.
Perhaps it will even invoke the OOM process killer.
...
604
Posted By MadeInGermany
In tr the number of characters in arg1 should...
In tr the number of characters in arg1 should match the number in arg2 - otherwise the behavior is not possible.
Convert directly to newline:
tr -s ' ,!' '\n\n\n' < filename
441
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...
318
Posted By MadeInGermany
Regarding your initial attempt, it is quite...
Regarding your initial attempt, it is quite close.
First, let me make a simplified version:
awk '! ($1 in A_Max) || $1 > A_Max[$1] { A_Max[$1]=$NF } END { for (a in A_Max) print A_Max[a],a }'...
601
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: Shell Programming and Scripting 2 Weeks Ago
488
Posted By MadeInGermany
You can boost your sed attempt sed ' ...
You can boost your sed attempt
sed '
/@inlineifset/,/^ *$/!d
/@inlineifset{mrg, @btpar{@/{
# Delete the previous search pattern
s///
:Loop
# Delete the end pattern; on success go...
Forum: What is on Your Mind? 2 Weeks Ago
535
Posted By MadeInGermany
Amazing! (Why do I feel a bit frightened?)
Amazing!
(Why do I feel a bit frightened?)
419
Posted By MadeInGermany
logrotate is awful. man logrotatedoes not well...
logrotate is awful.
man logrotatedoes not well enough clarify boarder cases.
Try to add
sharedscripts
This ensures that the postrotate action occurs once.
It work as well (or even better) to...
604
Posted By MadeInGermany
You mean the extra line? I guess there is a...
You mean the extra line?
I guess there is a space character after the server3; this extra space is converted to an extra newline.
517
Posted By MadeInGermany
Homework? According to the rules of this forum...
Homework?
According to the rules of this forum you must put a homework question in the sub forum "Homework and Emergencies" -> "Homework & Coursework Questions".
You find it further down the The...
604
Posted By MadeInGermany
Including a space in the [ ] is okay but there is...
Including a space in the [ ] is okay but there is also (at least) one following space.
So either have /[,.!? ] */ i.e. a following space is not required; this would also cover...
517
Posted By MadeInGermany
The ~ expands to an absolute path. If your tar is...
The ~ expands to an absolute path. If your tar is not GNU tar, then the leading / is not stripped off. And a relocation during extraction is impossible.
I would use cd and let the shell expand the...
517
Posted By MadeInGermany
How did you produce your tar file? What is its...
How did you produce your tar file?
What is its contents? tar -tf testtar.tar
Showing results 1 to 25 of 500

 

Featured Tech Videos

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