I agree with both of you regarding your comments and i will post a more detailed response shortly.
---------- Post updated at 01:35 PM ---------- Previous update was at 01:34 PM ----------
Now i have to post another response to allow me to send URL's in my detailed response :-)
---------- Post updated at 01:38 PM ---------- Previous update was at 01:35 PM ----------
ok more detailed coming next this forum software must have a bug as i have edited the offending URL add in my detailed post and it still will not let me post. Lets try again.
---------- Post updated at 01:40 PM ---------- Previous update was at 01:38 PM ----------
Ok here is what i have gone with now;
Quote:
Originally Posted by stomp
That for the state assignment...
What's regarding the output, printf kann handle format strings as described in the manpage: man 3 printf.
Example
Description
Output String variable $service_name with minimum length 20 chars - aligned left - then space then : then space then variable $service_state with minimum length 20 chars - aligned left and then new line.
---------- Post updated at 09:15 PM ---------- Previous update was at 01:40 PM ----------
Interestingly I have found that much of the script isn't needed with conky, however, it has been a valuable learning experience.
---------- Post updated at 09:16 PM ---------- Previous update was at 09:15 PM ----------
Hi bakunin, thank you for your comments and suggestions. I agree with your comments. I tend to notarize my scripts so that years later I do understand what I was doing at the time when I put the script together and also as technology evolves I can update it and make it better or more streamlined or reduce the number of processes as Stomp demonstrated.
Being reasonably new to the NIX platform and coding within it and I don't often need to do a lot of coding, I thought I would attempt to put good scripts together from the outset. I also have to mentioned of all the scripting languages I have used over the years BASH is fantastic and fast becoming my favorite - I do also like JavaScript.
Thanks for the comments and examples using sed - i didn't know you could do that - very valuable and i will be using that in future also.
Regarding printf - whilst putting this script together, i have been doing a lot of reading and looking at different examples around the internet and have found this command to be very powerful and prefer to keep scripts as super simple as possible and certainly where possible would prefer to use printf for formatting rather than adding another process of command into the logic. I was having trouble getting the syntax correct using printf (obviously my lack of knowledge and understanding) hence the reason I first attempted with sed.
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
#!/bin/sh
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
use $4
go
print"**Changes to the table... (0 Replies)
hi All,
I have the following two requirements:
case 1:
In a file i have the below code:
if ((a>b)) a=b;
else a = c;
by using some means i need to convert the line to the following output:
Output required:
case 2:
In a file i have the below code:
if (a>b)
a=b;
else
a... (4 Replies)
I have a file (file1) with in the below format
ST*820*212121
BPR*C*213212.20*C*212*CCD*01***01*071000013*DA*321321*101208
TRN*1*21321321*13213
N1*PR*3232. dff. SYS.*91*3232
ENT*1
N1*PE* 2132121321
RMR*TN*234456677888**192387.20*192387.20
REF*IV*234456677888*213213 3213 UNI... (0 Replies)
I am using blow script :--
#!/bin/bash
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
if
then
# echo "process found"
exit 0;
else
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below.
#masterscript.sh
./callingscript.sh
echo $fileExist
#callingscript.sh
echo "The script is called"... (2 Replies)
Hello all,
I am facing a weird issue while executing a code below -
#!/bin/bash
cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset
sh UKBA_publish.sh UKBA 28082015 3
if
then
echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)