I’ve been using this script for a long time to swap in a modified spellchecker word list
that has the correct spelling of all the fictional names, places, and other things used
in my book that I wouldn’t want to pass spell check if I was writing something else.
Then it opens a specific set of LyX documents, an LibreOffice document, and a blank
leafpad doc. Then after spinning off LyX, LibreOffice and leafpad, it fires up a
midnight commander shell in the appropriate directory… When I’m done, I close that
instance of midnight commander and my script resumes, swapping out the story-line dictionary
files in favor of the non-storyline version.
I use it to set up everything I need to work on the book I’m writing.
Well that and the online dictionaries I use to help me find the right word…
The script itself is located on my data partition and selected via a symbolic link in
my user “bin” on each of the three installed Linux distro’s I might be using when I
decide to work on my book. That way, if I modify the script to load a different set
of supporting documents, I only need to edit ONE copy of the script…
But I’ve just moved my stuff into a new desktop PC {Well new to me, My brother in
law murdered his copy of win7 and gave me the quad core HP Pavilion that used to be
his winbox.} It replaced my old xp era mono-processor Pavilion.
I installed and configured Mageia Linux (where this same script works on the new PC)
then I installed and configured Leap. Everything seemed to be working correctly.
All my personal keybindings do what they are supposed to. My openbox user environment
feels right. And I’d tested several of my other scripts. Then after testing that LyX
and LibreOffice worked properly this afternoon, I decided to work on my book a bit
tonight. Accordingly I ran my script. Or tried to…
I just wanted to work on my book’s plot for a while. I mean I interrupted the process
to move into my new Linux box. It’s almost been two weeks since I actually worked on
my book. And after tonight I still need to install and configure a third Linux. (I
suspect I’ll go with antiX for that again.)
But now I’m worried that something isn’t right with my Leap installation.
JtWdyP -> /home/jtwdyp/tmp
> j-stg
bash: /home/jtwdyp/bin2nd/j-stg: Permission denied
JtWdyP -> /home/jtwdyp/tmp
> ls -l ~/bin2nd/j-stg
lrwxrwxrwx 1 jtwdyp users 33 Jun 20 16:40 /home/jtwdyp/bin2nd/j-stg -> /home/jtwdyp/STUFFit/allbin/j-stg
JtWdyP -> /home/jtwdyp/tmp
> ls -l ~/STUFFit/allbin/j-stg
-rwxr-xr-x 1 jtwdyp users 6353 Jan 25 14:01 /home/jtwdyp/STUFFit/allbin/j-stg
JtWdyP -> /home/jtwdyp/tmp
>
What am I missing here? I mean there isn’t some new bash policy that forbids using a
symlink to start a user owned script or something, is there???
I suppose it might be helpful if I enclosed a copy of the script itself…
#! /bin/bash
# j-stg
# nano-symbionce +{# # Bio-SymBionce-_z_insertedTxT.lyx}
# # See also Bio-SymBionce
# Star_Travelers_Guild_-_story.lyx
# Star_Travelers_Guild_-_name_list.lyx
# Star_Travelers_Guild_-_outTakes.lyx
# Star_Travelers_Guild_-_Restrickted_outTakes.lyx
# note: try shortcut link to the script { stg }
# note: try this allbin script { j-stg } (symlinked in bin2nd)
# # Bio-SymBionce-_story.lyx
# # Bio-SymBionce-_name_list.lyx
# # Bio-SymBionce-_outTakes.lyx
# & etc . . .
#
echo
echo " you are about to spin of a lyx session and an libreoffice session"
echo " to the appropriate Biosymbionce files. And then use the current"
echo " konsole to open mc in the 'Biosymbionce' directory..."
echo
echo "Note: if you are not in a konsole or if you are already running"
echo " mc in it (hint use ^O to verify) then you should abort..."
echo
echo " press enter to continue"
echo " -or-"
echo " use ^c to abort"
echo
read dummy
# Note since running stg, will now enable storyline copy of spellcheck
# wordlists...
# test if can filter copy by greping for BranchCritter
#*# Also Note: due to the fact that the spellchecker won't confine itself to
#*# checking the spelling in a linear fashon, but will skip ahead to next
#*# occurance of same suspected misspell, I have begun confining it to a
#*# selected range by cutting the range out and temporarily pasting it in a
#*# seperate doc... the "spelltmp.lyx" file... spellchecking it there then
#*# again using cut N'paste to restore the results to the story file.
grepout=`grep BranchCritter /home/jtwdyp/.aspell.en.pws`
if "$grepout" = "" ]
then
# $HOME/.lyx/pwl_english.dict
# $HOME/snip/.mEspelLfiX.pwl
# preserve non-storyline spellcheck files
cp /home/jtwdyp/.aspell.en.prepl /home/jtwdyp/com/lyxSTUFF/.STGaspell/a/.aspell.en.prepl
cp /home/jtwdyp/.aspell.en.pws /home/jtwdyp/com/lyxSTUFF/.STGaspell/a/.aspell.en.pws
cp /home/jtwdyp/.config/enchant/en_US.dic /home/jtwdyp/com/lyxSTUFF/.STGaspell/a/en_US.dic
cp $HOME/.lyx/pwl_english.dict $HOME/com/lyxSTUFF/.STGaspell/a/pwl_english.dict
cp $HOME/snip/.mEspelLfiX.pwl $HOME/com/lyxSTUFF/.STGaspell/a/.mEspelLfiX.pwl
# restore storyline spellcheck files
cp /home/jtwdyp/com/lyxSTUFF/.STGaspell/s/en_US.dic /home/jtwdyp/.config/enchant/en_US.dic
cp /home/jtwdyp/com/lyxSTUFF/.STGaspell/s/.aspell.en.prepl /home/jtwdyp/.aspell.en.prepl
cp /home/jtwdyp/com/lyxSTUFF/.STGaspell/s/.aspell.en.pws /home/jtwdyp/.aspell.en.pws
cp $HOME/com/lyxSTUFF/.STGaspell/s/pwl_english.dict $HOME/.lyx/pwl_english.dict
cp $HOME/com/lyxSTUFF/.STGaspell/s/.mEspelLfiX.pwl $HOME/snip/.mEspelLfiX.pwl
echo "
storyline spellfiles enabled
"
else
echo "ERROR while preparing to back-up non-storyline spellfiles:"
echo " It was detected that the file ~/.aspell.en.pws"
echo " already contains BranchCritter"
echo ""
echo " Script will abort..."
echo ""
echo " It is recomended that you manualy fix spellfiles"
echo ""
echo " See /home/jtwdyp/com/lyxSTUFF/.STGaspell/Readme.txt "
echo ""
echo "Or you could try stgunspell if you imported it from laptop"
echo ""
echo "abort ABORT abor"
echo ""
exit
fi
# lyx ~/com/lyxSTUFF/Bio-SymBionce*.lyx ~/com/lyxSTUFF/Z_-_SpellCrapper.lyx ~/com/lyxSTUFF/Star_Travelers_Guild*.lyx ~/com/lyxSTUFF/rESTRICT_Star_Travelers_Guild*.lyx &
# lyx ~/com/E-bookSTUFF/Biosymbiont_2015/Biosymbionce.html.LyXconv/*.lyx &
lyx ~/com/E-bookSTUFF/Biosymbiont_book2/*.lyx ~/com/E-bookSTUFF/Biosymbiont_sourcefiles/*.lyx &
libreoffice ~/com/E-bookSTUFF/Biosymbiont_book2/BioSymBionce-2_XenDar.doc &
leafpad ~/com/E-bookSTUFF/Biosymbiont_book2/pasteShuttle.tmp &
mc ~/com/E-bookSTUFF/Biosymbiont_book2/
echo ""
echo " Do you want to syncronize spellcheck files with mEspelLfiX??"
echo ""
echo " Enter { S } to sync the Special storyline spellcheck files."
echo " Enter { R } to sync the Regular non-storyline spellcheck files."
echo " Enter { B } to sync Both."
echo " Enter { N } or {nothing} to NOT sync anything."
echo ""
read synC
case $synC in
[sS]*|bB*)mEspelLfiX;;
esac
grepout=`grep BranchCritter /home/jtwdyp/.aspell.en.pws`
if "$grepout" = "" ]
then
echo "ERROR while preparing to back-up storyline spellfiles:"
echo " It was detected that the file ~/.aspell.en.pws"
echo " NO LONGER contains BranchCritter"
echo ""
echo " Script will abort..."
echo ""
echo " It is recomended that you manualy fix spellfiles"
echo ""
echo " See /home/jtwdyp/com/lyxSTUFF/.STGaspell/Readme.txt "
echo ""
echo "This should not happen. But on at least one occasion the mc instance"
echo "spawned by a previous *stg run was still running when another *stg"
echo "instance was started {after running stgunspell} and then after the new"
echo "*stg instance was properly closed, the other mc was closed and it's parent"
echo "*stg tried to put away the storyline spellcheck files. Which overwote the"
echo "{source} storyline spell check files with NON-storyline versions"
echo "Which is why the *stg scripts now check for 'BranchCritter' before restoreing"
echo "the NON-storyline files too..."
echo ""
echo "abort ABORT abor"
echo ""
exit
else
# preserve & restore...
# preserve storyline spellcheck files
cp /home/jtwdyp/.aspell.en.prepl /home/jtwdyp/com/lyxSTUFF/.STGaspell/s/.aspell.en.prepl
cp /home/jtwdyp/.aspell.en.pws /home/jtwdyp/com/lyxSTUFF/.STGaspell/s/.aspell.en.pws
cp /home/jtwdyp/.config/enchant/en_US.dic /home/jtwdyp/com/lyxSTUFF/.STGaspell/s/en_US.dic
cp $HOME/.lyx/pwl_english.dict $HOME/com/lyxSTUFF/.STGaspell/s/pwl_english.dict
cp $HOME/snip/.mEspelLfiX.pwl $HOME/com/lyxSTUFF/.STGaspell/s/.mEspelLfiX.pwl
# restore non-storyline spellcheck files
cp /home/jtwdyp/com/lyxSTUFF/.STGaspell/a/en_US.dic /home/jtwdyp/.config/enchant/en_US.dic
cp /home/jtwdyp/com/lyxSTUFF/.STGaspell/a/.aspell.en.prepl /home/jtwdyp/.aspell.en.prepl
cp /home/jtwdyp/com/lyxSTUFF/.STGaspell/a/.aspell.en.pws /home/jtwdyp/.aspell.en.pws
cp $HOME/com/lyxSTUFF/.STGaspell/a/pwl_english.dict $HOME/.lyx/pwl_english.dict
cp $HOME/com/lyxSTUFF/.STGaspell/a/.mEspelLfiX.pwl $HOME/snip/.mEspelLfiX.pwl
echo ""
fi
echo " non-storyline spellcheck files restored"
echo ""
case $synC in
[rR]*|bB*)mEspelLfiX;;
esac
echo ""
echo "
# {disabled}preserve lyxSTUFF data via tarLyxSTUFF ( Y / N ) ???
"
# read tls
# case $tls in
# [yY]*) tarLyxSTUFF;;
# esac
Does anyone have a clue why bash is giving me: “Permission denied” when I try to run
my script???
–
JtWdyP