Hey guys, I'm brand new to the bash scripting world, here's my issue..
When people SSH to my box, I'm wanting to use screen to monitor them if I so choose. So, I've created a new user: testing, and I've set its startup shell to /bin/myshell.sh whose contents read this:
#!/bin/sh
$me = whoami
screen -S $me
/bin/bash
This is, for some reason, locking my entire system up..
Any help is greatly appreciated, as I've no clue what the hell I'm doing here. Thanks guys!
Hi
I also have a process that trigger every one minute. I use sleep function in script with infinite loop.
while [ 1 -lt 2 ]
do
clear
file=0
killall -u `whoami` -q soffice
soffice -invisible -norestore -nofirststartwizard -nologo -headless "-accept=socket,host=localhost,port=8100;urp;" &
sleep 15s
find /temp/papers/ -name ^.doc | while read a;
do
file=$(($file+1))
filename=`echo "$a" | sed 's/\(.\)...../\1/'`
echo Converting $filename.doc
python DocumentConverter.py "$filename^.doc" "$filename.pdf"
errorcode=$?
if [ $errorcode -eq 0 ]; then
mv "$a" "$filename.doc"
echo Successfully Convert $filename.doc
fi
if [ 0 -lt $errorcode ]; then
echo Can not convert $filename.doc error $errorcode
fi
done
killall -u `whoami` soffice
echo Total files: $file
echo Waiting for next interval
sleep 60s
done
I run the above script from Terminal, it is working fine.
I would like to start this process automatically on my linux startup.
So I put calling my script file in /etc/rc.d/rc.local.
When I reboot, OS hang on startup. I think OS is looping infinite loop of my script.