Currently, I use a line like this in my sh script file:
kill $(ps aux | grep -F 'myServer' | grep -v -F 'grep' | awk '{ print $2 }')
But I wonder how to call it only if process (myServer
here) is running?
Currently, I use a line like this in my sh script file:
kill $(ps aux | grep -F 'myServer' | grep -v -F 'grep' | awk '{ print $2 }')
But I wonder how to call it only if process (myServer
here) is running?
I have localized russian Ubuntu 11.10. But all my scripts use stuff like
REMOTE_REV=`svn info $REMOTE_REPO | grep '^Revision:' | awk '{print $2}'`
Where in my localization ^Редакция:
would do the job. I wonder if it is possible to tall svn info
in what language to responde instad of rewriting\localizing all my scripts grep
stuff?
I have a simple string I want to echo from my bash script:
$(document).ready(function() {$('#cf-footer-paragraph').append('<p>Revision 12345</p>');});
But any how I try to add \
before # I cant echo it=( So I wonder - how to echo such command?
I wonder if it is possible to create such .sh script that a normal user would be capable to start with something like nohup ./superScript.sh >& /dev/null &
and which would once a minute look into some SVN, find out current version and if there was an update run commands like:
kill `ps aux | grep -F 'ServerAPP' | grep -v -F 'grep' | awk '{ print $2 }'`
./server_automated_net_setup.sh
cd server/install-dir/
export LD_LIBRARY_PATH=./:~/server/install-dir/lib_boost:~/server/install-dir/lib_openSSL
nohup ./ServerAPP >& /dev/null &
that would kill currently running app, run some auto update script we already have in users home ~
and run it again.
Is it possible to create such script and how to do it?
I want to compile Boost with some specific options (eg: using zlib from its latest source)
So I try next bash code like:
WD=`pwd`
#//...
cd $BOOST_ROOT_DIR
echo_run ./bootstrap.sh
#// problem with \"$WD/$ZLIB_ROOT_DIR\"
echo_run ./b2 -j4 -d0 debug release --toolset=gcc --with-thread --with-system --with-filesystem --with-program_options --with-regex --with-date_time --with-iostreams -sZLIB_SOURCE=\"$WD/$ZLIB_ROOT_DIR\" link=static runtime-link=static --prefix=./$BOOST_INSTALL_SUBDIR install
echo Done!
But I get next outputfrom b2:
./b2 -j4 -d0 debug release --toolset=gcc --with-thread --with-system --with-filesystem --with-program_options --with-regex --with-date_time --with-iostreams -sZLIB_SOURCE="/home/tim/Рабочий стол/mask-viewer-standalone/MaskLoader/zlib_libraries" link=static runtime-link=static --prefix=./install-dir install
notice: could not find main target стол/mask-viewer-standalone/MaskLoader/zlib_libraries"
notice: assuming it is a name of file to create.
Which is preatty scarry!( (стол
is part of russian Ubuntu translation of Desctop
- Рабочий стол
)
So I wonder - what I do wrong - how to make b2
friend of paths with spaces?