Search Results

Search: Posts Made By: MadeInGermany
144
Posted By MadeInGermany
Is df /backup/Bckup_180320.tar &giving a...
Is
df /backup/Bckup_180320.tar &giving a result?
If it hangs hard, then there is some serious trouble. Then do further diagnostics, e.g. check mounts with
mount | grep /backupNot responding to...
133
Posted By MadeInGermany
The previous post is only for GNU sed that is...
The previous post is only for GNU sed that is compiled with a recent glibc that has got the \S \s from perl (PCRE (https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions)).
If you want...
1,089
Posted By MadeInGermany
Most easy: let the add.txt begin with an empty...
Most easy:
let the add.txt begin with an empty line!


If you really want an extra command to add the empty line, then...


The \n handling is a bit strange in GNU sed. The following seems to...
212
Posted By MadeInGermany
Of course it is [[ $string2 =~ ROS[0-9]+$ ]]...
Of course it is

[[ $string2 =~ ROS[0-9]+$ ]] && echo OK || echo NOK
Minimum one digit.
438
Posted By MadeInGermany
After studying the man page myself I have come to...
After studying the man page myself I have come to the conclusion that pax wants to either read files from a filesystem or write files to a filesystem or both.
So my first perception was wrong - pax...
438
Posted By MadeInGermany
pax can do some modifactions on a tar stream. ...
pax can do some modifactions on a tar stream.
man pax
375
Posted By MadeInGermany
In your .forward file, put \username,...
In your .forward file, put
\username, outlookuser@address
That should forward to the local inbox of "username" and send a copy to the outlook address.
Perhaps the comma is not accepted as a...
Forum: Shell Programming and Scripting 2 Weeks Ago
938
Posted By MadeInGermany
As Scrutinizer said, %q is likely not portable. ...
As Scrutinizer said, %q is likely not portable.
And, %q solves a problem that would deserve a better solution.
The natural delimiter for piped input is a newline.
So perhaps you can use that?
Try...
Forum: Shell Programming and Scripting 2 Weeks Ago
938
Posted By MadeInGermany
Did you really read my post? I wanted to tell...
Did you really read my post?
I wanted to tell you this:
# Simple echo
echo_(){
( IFS=" "; printf "%s\n" "$*" )
}

ECHO=echo_
The function is named echo_ (not echo and not echo_!)
and has...
Forum: Shell Programming and Scripting 2 Weeks Ago
938
Posted By MadeInGermany
Use an echo_ function...
Use an echo_ function (https://www.unix.com/shell-programming-and-scripting/283413-tip-better-echo.html?highlight=tip)
and set ECHO=echo_!
301
Posted By MadeInGermany
Do you have the command that does it (once)? ...
Do you have the command that does it (once)?
Then you can put it into crontab with an appropriate schedule.
Read about the crontab with
man crontab
Forum: Homework & Coursework Questions 2 Weeks Ago
741
Posted By MadeInGermany
604 permission means r+w for owner, nothing for...
604 permission means
r+w for owner, nothing for group, w for others!
This is very unsafe: others may alter the file!
Check with "ls -l filename".
1,089
Posted By MadeInGermany
You had the wrong quotes. sed -i "/$arg/r...
You had the wrong quotes.
sed -i "/$arg/r add.txt" ssl.confand the shell will substitute the $arg.

--- Post updated at 11:14 ---

But if you have multiple Listen and want to insert test after...
489
Posted By MadeInGermany
Good to know. Bash was first with brace...
Good to know. Bash was first with brace expansion, now ksh and zsh are ahead. Let's see when bash will catch up again.
BTW, Bash-4 has got a number + field alignment expansion:
echo {01..10}
01 02...
489
Posted By MadeInGermany
... or a loop, that correctly handles special...
... or a loop, that correctly handles special characters in file names, and can verify that the files exist:
for (( i=1; i<=10; i++ )); do
f=/path/to/files/$i.dat
[ -f "$f" ] && cp "$f" ./...
818
Posted By MadeInGermany
sed -n "s/$key/$value/gp" $inputonly prints lines...
sed -n "s/$key/$value/gp" $inputonly prints lines where a substitution occurred.

But it won't print any existing lines that have not be substituted.
The following bash-4 script is a universal...
818
Posted By MadeInGermany
Yes that is the correct format. And it should...
Yes that is the correct format.
And it should be sed "s/$key/$value/g" with normal (double-)quotes, so the shell can expand $key and $value.

A more efficient way is to let the read command spllit...
818
Posted By MadeInGermany
Furthermore, sed gets the $line as a filename. ...
Furthermore, sed gets the $line as a filename.
If it should get it as input then do
echo "$line" | sed ...
Some shells (bash, zsh) take as well
sed ... <<< "$line"
818
Posted By MadeInGermany
The s command in sed takes one $key value and one...
The s command in sed takes one $key value and one $value value.
Apparently you need a loop that in each cycle gives one $key/$value pair.
818
Posted By MadeInGermany
Simply use two s commands: sed 's/.*\$\$//;...
Simply use two s commands:
sed 's/.*\$\$//; s/\..*//' test.txtIn the case there is no $$ it will still remove everything after a dot.
The following would avoid that:
sed '/.*\$\$/ { s///;...
583
Posted By MadeInGermany
It does not make sense to me. The purpose of...
It does not make sense to me.
The purpose of the bind mount is to let it appear under /home/ - why do you want to break it?
245
Posted By MadeInGermany
Why not shell only? The shell's read command...
Why not shell only?
The shell's read command reads the remainder into the last given variable; that's exactly what is desired here.
while read x name x x description
do
echo -e...
481
Posted By MadeInGermany
Consolidated to 3 lines of shell code: cat...
Consolidated to 3 lines of shell code:
cat LOTCCLUS_stat
if [[ `wc -l < LOTCCLUS_stat` -gt 2 ]]; then ok="NOK"; else ok="OK "; fi
echo "##### THE LOTC cluster state is $ok ##########"
630
Posted By MadeInGermany
GNU sed and maybe BSD sed support ExtendedRE with...
GNU sed and maybe BSD sed support ExtendedRE with a - r or -E option.
Then you can do a universal search:
sed -i -r '/(^|,)GETaboutUsCSS(,|$)/d' file
At the left side there must be either the...
306
Posted By MadeInGermany
A more detailed explanation follows. The main...
A more detailed explanation follows.
The main awk code runs for each input line.
!a[$0]++ is ultra-condensed, quick and dirty.
A bit more explicit is !($0 in A) { A[$0]; print }:
If not $0 in...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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