Search Results

Search: Posts Made By: MadeInGermany
Forum: Shell Programming and Scripting 2 Hours Ago
124
Posted By MadeInGermany
The echo $a1 | ssh ... redirects stdin - but...
The echo $a1 | ssh ... redirects stdin - but nothing reads from it.
You can just redirect stdin with </dev/null ssh ... or close stdin with ssh -n ...; that should have the same effect and not...
131
Posted By MadeInGermany
You want "$line" to be the input data for sed,...
You want "$line" to be the input data for sed, not a file name.
Is this home work / course work?
210
Posted By MadeInGermany
The OS is Linux, as stated in post #5. Linux...
The OS is Linux, as stated in post #5.
Linux distros have got pgrep/pkill soon after Sun introduced them on Solaris. They were pretty welcome because the traditional Linux commands pidof/killall got...
159
Posted By MadeInGermany
bash does integer arithmetics only. awk...
bash does integer arithmetics only.
awk '{tot+=length+1; spc+=gsub(/[[:blank:]]/,"")+1} END{print spc/tot}' afile
The +1 takes the newline character into account like the previous wc.
210
Posted By MadeInGermany
Yes pkill -u med && sleep 5 && pkill -9 -u med...
Yes pkill -u med && sleep 5 && pkill -9 -u med would be a smart command (the "friendly" kill first).
241
Posted By MadeInGermany
The sed definitely has the "range must span over...
The sed definitely has the "range must span over two or more lines" problem.
Thanks Scrutinizer for showing that awk does not have this restriction.
Also perl does not have this restriction:
perl...
241
Posted By MadeInGermany
A range must span over two (or more) lines. ...
A range must span over two (or more) lines.
With a status variable it may end on the same line:
awk '/Umbist_reverse_inst/ {r=1}; r {gsub(/\(\)/,"")}; /\);/ {r=0}; 1' list
If the start pattern is...
353
Posted By MadeInGermany
The fixes are ^version to require the beginning...
The fixes are ^version to require the beginning of the line, and \" for a " within " ".
Short solutions:
sed "s/^\(version=\).*/\1\"$new_version\",/" filename.txtsed "/^version=/...
Forum: Programming 1 Week Ago
764
Posted By MadeInGermany
BTW in many cases a trim function comes in handy....
BTW in many cases a trim function comes in handy.
For example, the fuzzy strstr() that can match a portion of the string can be replaced with an exact strcmp()
...
//...
Forum: Programming 1 Week Ago
764
Posted By MadeInGermany
The empty line prints str1. Because it was not...
The empty line prints str1.
Because it was not matched in scanf() it has the value from the previous line - therefore the str1= assignment,
should set it to "" with one of
str1[0]=0 or...
Forum: Solaris 1 Week Ago
347
Posted By MadeInGermany
Perhaps some /dev/ links are missing (that point...
Perhaps some /dev/ links are missing (that point to the /devices/ paths)?
man devfsadm
Usually one can do
devfsadm -v -C -c disk
to rebuild the /dev/ links.
302
Posted By MadeInGermany
vLnArray=( $vline ) without quotes does word...
vLnArray=( $vline ) without quotes does word splitting (wanted) and glob matching (not wanted).
A safer method is to let the read do the word splitting, either into discrete variables (see post #2)...
128
Posted By MadeInGermany
The a becomes a_a The following bc remains...
The a becomes a_a
The following bc remains unchanged.
128
Posted By MadeInGermany
The abc is passed to sed. The sed substitutes a...
The abc is passed to sed.
The sed substitutes a by a_a.
& is what matched, and the a matches an a.
283
Posted By MadeInGermany
Perhaps you want for f in CAT_Run??.ica; do ...
Perhaps you want
for f in CAT_Run??.ica; do
test -f "$f" &&
echo mv "$f" "${f#CAT_}"
doneImportant: the arguments to mv (and test) must be in "quotes".
297
Posted By MadeInGermany
[My tcl knowledge is limited,] Do you know the...
[My tcl knowledge is limited,]
Do you know the two values pkram and sysram in advance? Then you can use two globs:
glob -type f modified_rtl_files/*/*{wrapper_hsm_pkram}* and
glob -type f...
Forum: Programming 1 Week Ago
764
Posted By MadeInGermany
The str1 variable is too small. "sample10" is 8...
The str1 variable is too small. "sample10" is 8 characters, so str1 must have 8+1=9 bytes wide at least.
char name[256]; //1st part (key part) parsed from each line[]
char str1[12]; ...
Forum: Programming 1 Week Ago
764
Posted By MadeInGermany
The code that you provided stops at line 8 with...
The code that you provided stops at line 8 with exit 1:
...
printf("%s: %s\n", name, str1); //puts() always adds newline at the end of the string
//printf("%d\n", i);
...
Forum: Programming 1 Week Ago
764
Posted By MadeInGermany
Again it worked for me, with the infile.txt from...
Again it worked for me, with the infile.txt from your post #1.
Perhaps it helps to make your strings more robust:
char line[256]; //for row read from file
char name[256]; //1st...
Forum: Programming 1 Week Ago
764
Posted By MadeInGermany
For me it works: the red phrases land in the blue...
For me it works: the red phrases land in the blue variables.
But there can be trailing spaces in name because %[^:] matches up to the :
Forum: Solaris 1 Week Ago
469
Posted By MadeInGermany
pgrep inetd shows the process and pkill -HUP...
pgrep inetd shows the process and
pkill -HUP inetd reloads it.
It is necessary to inform inetd, because it starts the service daemons in inetd.conf on demand.
-1 should be identical to -HUP
When...
511
Posted By MadeInGermany
In fact I get a different (wrong) result in...
In fact I get a different (wrong) result in bash-3 for
. <(echo $LINE
and identical (correct) results in all shells for
. <(echo "$LINE"
eval $LINE
eval "$LINE"
511
Posted By MadeInGermany
I wonder if . <(echo $LINE) does the same as eval...
I wonder if . <(echo $LINE) does the same as eval $LINE.?
381
Posted By MadeInGermany
In the shell you can do awk -f average1.awk...
In the shell you can do
awk -f average1.awk "$1" | (read h; echo "$h"; sort)
Within the awk script you can do something like
NR==1 {print}
... {print | "sort"}
597
Posted By MadeInGermany
There must be a bug in that version of...
There must be a bug in that version of environment-modules.
Are there any results of
grep -w ENV /etc/profiles.d/modules*where ENV is assigned the /usr/share/Modules/init/ ?
Then this mistake...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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