This is probably another thread, but what's the best way to do config
files. At the moment, I just use...
cat config_file|grep var_name|cut -d'=' -f2
... which is fine for what I've been doing, but I'm not sure what to
do when there are a variable number of entries and I want it go through
them like a list.
Course, the config file itself could be a script but I prefer to keep
the configs seperate from the functions. Not really sure how to do
this. It's a problem sometimes, though I can usually hack up some kind
of work-around for my ignorance.
...
Is there any reason my rather humble implementation is undesirable or
problematic?
If you plan to deploy that alarm into a mission critical process daylight saving time and in general adjustments to the system clock may be problematic for your script.
If you plan to deploy that alarm into a mission critical process daylight saving time and in general adjustments to the system clock may be problematic for your script.
Great to know! Thanks.
---------- Post updated at 05:26 PM ---------- Previous update was at 04:58 PM ----------
Why not directly use the date-$time check as the loop condition? This way, $trig is not needed. Also, it may be more useful to have this script return the exit status of $command.
For your consideration:
Also, for portability, I made some minor modifications that may not be of any interest to you.
Since there's nothing bash-specific about this little script, I changed /bin/bash to /bin/sh. Should you ever need to run it on a system that does not have bash, it will still work.
A system without bash may have a date command that does not support the %R format. Since that's equivalent to the standard %H:%M, I used that instead.
That's excellent. I'm always happy to see better ways of doing it. I just somehow had it in my head that it would be an if condition before I started, so it never occured to me to put the condition in the loop itself.
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
This is the script:
#!/bin/sh
if ; then rm -rf /usr/share/WallpaperChanger; fi
if ; then rm -rf /usr/bin/wallch; fi;
if ; then rm -rf /usr/share/applications/wallch.desktop; fi
if ; then rm -rf /usr/share/doc/wallch; fi
if ; then rm -rf /usr/share/man/man1/wallch.1.gz; fi
echo "Delete... (4 Replies)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
I have written following code to do: ls -l | wc -w, it works:
but when there are not only a single "|", if there are more such as:
ls -l | sort -r | sort | sort -r, This program does not work, i want to know how could i deal with it when there are more "|", another situation is that, if it mixes... (2 Replies)