Re: create-sbu_du-report.sh empty var

"Thomas Seeling" ([email protected] via alfs-discuss Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.automated
Organization Kleintierpraxis Berstadt
Message-ID <[email protected]>
Hallo Pierre,

> I guess it is better to check a posteriori whether J_VALUE has a value...
> Can you test that the change in commit 0f3b1c3 fixes your issue please?

testing J_VALUE after running the sed commands is not useful, it still
complains about "unary operator expected".

If the config/report file does not contain either keyword the if is
still empty on the left-hand side of the comparison.

Legis arte would be checking if either keyword is present and only in
this case enter the if clause, and if neither keyword is present use a
default value of 1.

if egrep -q "N_PARALLEL|REALSBU" "${REPORT}"
then
   if [ $(sed -n '/REALSBU/s/.*\([yn]\).*/\1/p' "$REPORT") = y ]; then
     J_VALUE="1"
   else
     J_VALUE=$(sed -n '/N_PARALLEL/s/.*<\([^>]*\).*/\1/p' "$REPORT")
   fi
else
   J_VALUE="${J_VALUE:-1}"
fi


Stay healthy,
Thomas
--
Do you wanna be a legend or a passing footprint on the sands of time?

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.