Search Results

Search: Posts Made By: MadeInGermany
371
Posted By MadeInGermany
Obviously ksh88 - that knows [[ ]] but not its ...
Obviously ksh88 - that knows [[ ]] but not its =~ operator.
Is it possible to use bash instead?
122
Posted By MadeInGermany
Obviously it does so :( Once in Solaris...
Obviously it does so :(

Once in Solaris there was a bug that a "crontab" command wiped the crontab, even if it was aborted with Control-C.
Sun fixed it soon.

BTW, I have some scripts that...
122
Posted By MadeInGermany
Looks like a little bug. crontab filename...
Looks like a little bug.
crontab filename should check that filename exists and is a regular file (not a directory, device node, or other special file).

Just crontab (without arguments) should...
114
Posted By MadeInGermany
Do you want to only replace the D5 ? The...
Do you want to only replace the D5 ?
The following merge script replaces D5 and D6 (all what matches);
#!/bin/ksh
# also works with bash-4

# Merge script: the two input files must be in the...
157
Posted By MadeInGermany
Or simply /bin/df . That by default tells the...
Or simply
/bin/df .
That by default tells the "ifree" as "files", and works with "network shares" (NFS and others).
188
Posted By MadeInGermany
I guess the Linux subsystem works with the...
I guess the Linux subsystem works with the Windows kernel, and that does not perform like a Linux kernel.

So why not the opposite - Linux and Wine?
Forum: HP-UX 4 Days Ago
163
Posted By MadeInGermany
A recent Gnome is very hard to build, because it...
A recent Gnome is very hard to build, because it depends on a dozen Linux-specifics: glibc, glib, xrandr, gvfs/fuse, dbus, systemd.
I was surprised that Oracle has done the effort for Solaris 11....
262
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...
207
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,495
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...
371
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.
583
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...
583
Posted By MadeInGermany
pax can do some modifactions on a tar stream. ...
pax can do some modifactions on a tar stream.
man pax
552
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
1,418
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
1,418
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 3 Weeks Ago
1,418
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_!
411
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 3 Weeks Ago
864
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,495
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...
628
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...
628
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" ./...
1,004
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...
1,004
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...
1,004
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"
Showing results 1 to 25 of 500

 

Featured Tech Videos

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