Unix/Linux Go Back    

Showing results 1 to 25 of 500
Search took 0.11 seconds.
Search: Posts Made By: MadeInGermany
Forum: Shell Programming and Scripting Linux 18 Hours Ago
Replies: 9
Views: 203
Posted By MadeInGermany
Why do you want to translate position numbers to...

Why do you want to translate position numbers to values?
Normally you simply walk through the given values
echo "here are the $# values:"
for arg
do
echo "$arg"
done
for arg is short for for...
Forum: Solaris Linux 2 Days Ago
Replies: 8
Views: 189
Posted By MadeInGermany
control-d bypasses the maintenance mode and boots...

control-d bypasses the maintenance mode and boots to multi-user mode i.e. run-level 3.
You must enter the root password to enter the maintenance mode!
Forum: Shell Programming and Scripting Linux 2 Days Ago
Replies: 9
Views: 225
Posted By MadeInGermany
Standard sed sed ' s/\(..\)\(..\)\(..\)/\1 \2...

Standard sed
sed '
s/\(..\)\(..\)\(..\)/\1 \2 \3\
/g
' fileIf you want to get rid of the last newline, the effort is much higher.
Here is an attempt
sed '
/\(..\)\(..\)\(..\)\(.\)/{
s//\1 \2...
Forum: Shell Programming and Scripting Linux 2 Days Ago
Replies: 5
Views: 196
Posted By MadeInGermany
Don, your solution was 100% correct, as always! ...

Don, your solution was 100% correct, as always!
As a note, within $(( )) and (( )) evaluation you do not need further $ evaluations. So the following works as well
for (( i=0; i<n; i++ ))for ((...
Forum: UNIX for Beginners Questions & Answers Linux 2 Days Ago
Replies: 7
Views: 176
Posted By MadeInGermany
The "Linux" kernel handles the...

The "Linux" kernel handles the scheduling/multitasking and all the I/O, and it knows what an UIDs/owner is.
But it does not know what a shell is, and does not know that a UID is stored in a passwd...
Forum: UNIX for Beginners Questions & Answers Linux 3 Days Ago
Replies: 10
Views: 223
Posted By MadeInGermany
I wonder if one can include an optional comma...

I wonder if one can include an optional comma ,\{0,1\} in the main substitution
sed 's/,\{0,1\}[^,]*: //g' file
Forum: Shell Programming and Scripting Linux 4 Days Ago
Replies: 15
Views: 592
Posted By MadeInGermany
The awk '++s[$2]==10'lists the 10th occurrence...

The
awk '++s[$2]==10'lists the 10th occurrence of column#2, and if there are more than 10 it will not wipe a previously printed one ;)
You can search for certain strings through the whole line like...
Forum: Shell Programming and Scripting Linux 4 Days Ago
Replies: 2
Views: 142
Posted By MadeInGermany
The "here document" is the correct method of...

The "here document" is the correct method of storing a password in the script.
--
If you have a pwlist with one password per line then you can do
while IFS= read -r pw
do
printf "%s\n" "$pw"
...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 15
Views: 592
Posted By MadeInGermany
Sure, you can add another -o pid= column, and you...

Sure, you can add another -o pid= column, and you can change -o comm= to -o args=
Rule: put the predictable columns first, and have the args last!
ps -u abcd -o pid= -o args=The trailing = means...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 15
Views: 592
Posted By MadeInGermany
You can test the output for being empty. For...

You can test the output for being empty.
For example you can store it in a varable, and test that for being empty (-z Here: -n not empty).
jobs=$(ps -u abcd -o comm= | awk '($1=="a.ksh" ||...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 15
Views: 592
Posted By MadeInGermany
Do you see it now? cmd = "echo \"Found "...

Do you see it now?
cmd = "echo \"Found " p_counter[k] " instances of " k " running\"
^ unterminated...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 5
Views: 308
Posted By MadeInGermany
set files=( "$file1" "$file2" "$file3" ) set...

set files=( "$file1" "$file2" "$file3" )
set obsids=( "$obsid1" "$obsid2" "$obsid3" )

set i=1

while ($i <= $n)
dmcopy "${files[$i]}[energy=500:7000&&(x,y)=circle(${c},${r})][bin sky=1]"...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 4
Views: 282
Posted By MadeInGermany
Save this as test3.sh #!/bin/sh while read...

Save this as test3.sh
#!/bin/sh
while read lib
do
echo "lib $lib, logfile $lib.log"
{
# now output is redirected to the logfile
echo "$lib.log created `date`"
} > "$lib.log"
done...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 2
Views: 247
Posted By MadeInGermany
$ man userdel ... - r Remove the...

$ man userdel
...
- r Remove the user's home directory from the system. This
directory must exist.
...Create the homedirectory in case it does not exist:
#!/bin/ksh...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 5
Views: 308
Posted By MadeInGermany
(Skipping the compulsary "don't use csh" reply.) ...

(Skipping the compulsary "don't use csh" reply.)
No, the assembly of a variable like ${file${i}} doesn't work.
You can use a list, for example
set files=( $file1 $file2 $file3 )
set i=1
echo...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 5
Views: 360
Posted By MadeInGermany
Most likely there is a time-out on the DB server....

Most likely there is a time-out on the DB server.
Like this:...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 6
Views: 318
Posted By MadeInGermany
To avoid a "files are identical" error better...

To avoid a "files are identical" error better ensure that the source file has a : character
for FN in *2017*.csv_*:*; do ...BTW the // modifier works in bash and zsh and ksh93.
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 4
Views: 293
Posted By MadeInGermany
Or with sed sed ' s/$/,/ ...

Or with sed
sed '
s/$/,/
s/"\{0,1\}\([^"]*\)"\{0,1\},/\1|/g
s/|$//
' file
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 9
Views: 437
Posted By MadeInGermany
Hmm I think asynchronous background jobs MUST go...

Hmm I think asynchronous background jobs MUST go to separate logs.
Otherwise they might overwrite each other, and the shared log file becomes a mess.
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 2
Views: 229
Posted By MadeInGermany
Do you have the status.sh working? What is its...

Do you have the status.sh working?
What is its output when it finds Running? And when it finds Shutdown?
Forum: Red Hat Linux 1 Week Ago
Replies: 7
Views: 287
Posted By MadeInGermany
Certainly you want strace -t -p $PID...

Certainly you want
strace -t -p $PID 2>strace_output.txt
Forum: UNIX for Beginners Questions & Answers Linux 1 Week Ago
Replies: 22
Views: 645
Posted By MadeInGermany
This is risky, a variable in a command argument...

This is risky, a variable in a command argument that is not in "quotes".
A fix is
echo "$RESULT" > $FILE
You do not use the variable elsewhere, so try to directly produce the file...
Forum: Shell Programming and Scripting Linux 2 Weeks Ago
Replies: 5
Views: 360
Posted By MadeInGermany
Certainly not a script problem with the script. ...

Certainly not a script problem with the script.
Maybe there is a limit (e.g. max transfer size) exceeded in the DB server?
Check all its error logs.
Also there might be a bug (or a tunable limit)...
Forum: UNIX for Beginners Questions & Answers Linux 2 Weeks Ago
Replies: 10
Views: 448
Posted By MadeInGermany
... is a performance boost in comparison to -exec...

... is a performance boost in comparison to -exec rm {} \;
But nothing beats -delete!
Forum: UNIX for Beginners Questions & Answers Linux 2 Weeks Ago
Replies: 10
Views: 448
Posted By MadeInGermany
The glob /home/linux/txt/output/ABC_DEFGH* cannot...

The glob /home/linux/txt/output/ABC_DEFGH* cannot filter for file age.
But you can do all with find, even limit the search depth
if cd /home/linux/txt
then
find . -maxdepth 1 -type f -name...
Showing results 1 to 25 of 500

 


All times are GMT -4. The time now is 10:18 PM.