Search Results

Search: Posts Made By: MadeInGermany
19,511
Posted By MadeInGermany
Thank you! I have never heard of the boot -F...
Thank you! I have never heard of the boot -F failsafe before.
Have read about it now: an Oracle article says it must exist as /platform/`uname -m`/failsafe.
I have access to an older Solaris 10...
20,797
Posted By MadeInGermany
A shell script with only shell builtins: ...
A shell script with only shell builtins:
#!/bin/sh
set -f # unquoted $f2
IFS=";"
while IFS="," read f1 f2
do
printf "$f1, %s\n" $f2
done < file
24,921
Posted By MadeInGermany
grep -l prints the file names so you can process...
grep -l prints the file names so you can process them with xargs.
grep --include="*.org" --include="*.texi" -lir "Abstract" . | xargs headBut xargs has a problem with space characters in file names....
75,034
Posted By MadeInGermany
When read indicates an EOF and the loop ends, it...
When read indicates an EOF and the loop ends, it still has read the last incomplete line into the variable.
So you can process it after the loop.
do_dirn(){
echo "dirn :$dirn"
}
printf...
Forum: Solaris 01-24-2020
25,269
Posted By MadeInGermany
Look for an update of the driver/firmware. You...
Look for an update of the driver/firmware.
You bought them from Oracle? Contact Oracle support!
16,577
Posted By MadeInGermany
awk can do this during reading the input file -...
awk can do this during reading the input file - no need to store everything and process in the END section.
awk '$1~search {p=1} NF==0 {p=0}; p' search="NUMADDR" fileThe p variable controls when to...
18,188
Posted By MadeInGermany
crontab -l list. crontab -e edit with default...
crontab -l list.
crontab -e edit with default editor.
EDITOR=nano crontab -e edit with nano.
(crontab -l; echo '2 18 * * 0,2,4,6 find /tempr/DSC/PH[123]* \! -type d -mtime +3 -exec rm -f {} +') |...
112,157
Posted By MadeInGermany
That explains it; and your photo shows a...
That explains it; and your photo shows a non-ascii character.
It's not sufficient to sort out [a-zA-Z].

With an ERE you can ensure the input is a number:
[[ $NUM =~ ^[0-9]+$ ]] || continue
echo...
112,157
Posted By MadeInGermany
&2>/dev/null is still odd, the & is too many. The...
&2>/dev/null is still odd, the & is too many. The & before a descriptor number is needed on the RHS only, to distinguish it from a file name.
And, the only errors that a [[ ]] can produce are...
112,157
Posted By MadeInGermany
The grep args should be quoted so the shell does...
The grep args should be quoted so the shell does not try a filename generation.
builtin echo "$NUM" | $GREP -q "[a-zA-Z]" && continue
22,729
Posted By MadeInGermany
I forgot that read by default omits leading space...
I forgot that read by default omits leading space (add IFS=), and mistreats a backslash (add -r).
Should be
IFS= read -r STRING << "EOT"
...
4,602
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...
67,976
Posted By MadeInGermany
arr=("$@") Quotes around $@ (and ${arr[@]})...
arr=("$@")
Quotes around $@ (and ${arr[@]}) protect against word splitting and other substitutions, but still retain the list of argument members (and other array members).

In contrast, with $*...
17,465
Posted By MadeInGermany
Hmm, vi should actually work. But easier is ...
Hmm, vi should actually work.
But easier is
touch myfile
or
> myfile
9,725
Posted By MadeInGermany
In ksh88 (and bash) you can emulate f [[ ( $a...
In ksh88 (and bash) you can emulate
f [[ ( $a =~ sss[0-9]*$ ) ]]
with
if [[ $a == *sss* ]] && [[ ${a##*sss} != *[!0-9]* ]]
And
f [[ ( $a =~ ^sss[0-9]*$ ) ]]
with
if [[ $a == sss* ]] && [[...
4,602
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...
13,903
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...
4,749
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...
9,725
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.
8,625
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...
118,771
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...
118,771
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_!
2,665
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
11,434
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...
13,572
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

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