I have a script that runs commands & takes a screen shot. I want the man file to display & grab a screen shot of it. My script works for the commands alone but if I add "man " before the command it just gives an error "man command not found"
try(){
clear
timeout 0.2 $1
re=$?
echo trying $1>>log.txt
echo result is $re>>log.txt
if [ ! $re -eq 127 ]; then
sleep 0.2
import -window osboxes@osboxes:~/Downloads/Parser\ Project\Code/iteration\ 3 iter3/$1.png
echo $1 captured>>log.txt
fi
}
try man\ AB
try man\ ABRT\-ACTION\-ANALYZ
try man\ ABRT\-ACTION\-ANALYZ
try man\ ABRT\-ACTION\-ANALYZ
...etc
The list of commands is quite long but they all exist on the system.
Also if I just have:
try ABRT-ACTION-ANALYZ or try AB for example then it finds the commands & works but of course not showing the man file.
Please don't ask my why I don't look at the man files some other way - I am asking how to get this script to work.
Is it possibly a man path issue?
manwhich displays manual for some command?\(backslash-space) aftermanand then in the try function using a$2such astimeout 0.2 $1 $2