Ask Your Question

Problem with users in a shell script

asked 2015-12-24 06:57:28 -0500


I have downloaded this font archive: profont-x11.7z and I've made this script to install it:



echo "Start install"
mkdir -p /usr/share/fonts/profont

echo "Extracting 7z File"
7za e profont-x11.7z -o/usr/share/fonts/profont

echo "Entering Font Directory"
cd /usr/share/fonts/profont

echo "Deleting Unnecessary Files"
rm -df LICENSE readme.txt profont-x11/

echo "Installing font"
chmod 644 *.pcf -R

echo "Leaving Font Directory"

echo "Done!"
cd -

The problem is the output doesn't show until I enter the exit command on the prompt. I mean, it stays logged as root, and I have to manually exit the su command to make it work. Why is that?

Thank you for your help

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-12-24 10:50:02 -0500

sideburns gravatar image

Welcome to ask.fedora. I'm not sure why you need to create a script to automate a job that you're only going to do once, or why the exit command inside the script isn't enough. You may find more information in this tutorial:

My suggestion, if you must use a script, is to take the su and exit out, then create a second script that calls the firs with su -c. That guarantees that you're not still root when it's done.

edit flag offensive delete link more


Thank you for your answer. I used this script to install several fonts (monotypes for testing on my source editors). Hope I can learn from all of you, guys.


damonh gravatar imagedamonh ( 2015-12-30 08:18:22 -0500 )edit

Question Tools

1 follower


Asked: 2015-12-24 06:57:28 -0500

Seen: 65 times

Last updated: Dec 24 '15