Working in a bash environment, in the following example, how do I direct the error message that putting in an invalid flag (-j for example) would normally produce to dev/null?
while getopts "abcd" opt
do
case "$opt" in
i) a etc ;;
r) b etc ;;
f) c etc ;;
v) d... (7 Replies)
Hi,
I have a shellscript that produces a csv that can be opened in Microsoft Excel. It has two columns and about 10 rows in each column, so only twenty cells (at the moment). When the user opened the csv, I wanted it so autofilter was already turned on in columns A1 and B1 (and potentially C1,... (1 Reply)
I have an input file having 7 fields delimited by ,
eg :
1,ABC,hg,1,2,34,3
2,hj,YU,2,3,4,
3,JU,kl,4,5,7,
4,JK,KJ,3,56,4,5
The seventh field here in some lines is empty, whereas the other lines there is a value.
How do I insert string NULL at this location (7th loc) for these lines where... (8 Replies)
I am testing some file routines against potential "nasty name" Unix files, such as those with a CR, LF, in the middle or NULL terminated, utf multi-byte character. So, under Bash, I want some way of:
mv "name" "name\0"
with the \0 a real NULL.
Against all my efforts, I have not been... (2 Replies)
Okay so i have a script i wrote in python. I want to turn this script into an INSTALLED COMMAND to run in terminal.
Right now i run it like this in terminal...
$ python myscriptname.py
or
$ ./myscriptname.py
but i want to be able to run it like this in terminal...
$ myscriptname
... (3 Replies)
Hi,
I was just helped with an excellent one liner. Now I need to know how to turn it into a script that I can call at the command line. So, this works with file script:
------------
for file in DATA.txt;
do
awk 'NR==1;NR>1{for (i=1;i<=NF;i++){a+=$i}}END{for (i=1;i<=NF;i++){printf... (3 Replies)
Hi everybody!
I am writing a script which accepts two arguments one of them being a message. All is working except for the message part. That is, to accept text as an argument.
I have trouble storing and echoing a line of text. It seems that writing a few words and store them in an... (6 Replies)
There are 4 parameters that I have to pass from korn shell to sql script.
1) I have to check if $1 , $2 , $3 and $4 are null values or not .
How can I do that ?
2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
I have a shell script which select total count from a table and use its value in a if condition like below
connect_string="username/password@tnsname"
tot=`sqlplus -s $connect_string << EOF
set echo off
set feedback off
set head off
select count(*) from test_table;
EOF
`
if
then
echo... (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)
Discussion started by: siegfried
3 Replies
LEARN ABOUT OPENDARWIN
cpu_capabilities
cpu_capabilities(3alleg4) Allegro manual cpu_capabilities(3alleg4)NAME
cpu_capabilities - Contains the capability flags of the CPU. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
extern int cpu_capabilities;
DESCRIPTION
Contains CPU flags indicating what features are available on the current CPU. The flags can be any combination of these:
CPU_ID - Indicates that the "cpuid" instruction is
available. If this is set, then all Allegro CPU
variables are 100% reliable, otherwise there
may be some mistakes.
CPU_FPU - An FPU is available.
CPU_IA64 - Running on Intel 64 bit CPU
CPU_AMD64 - Running on AMD 64 bit CPU
CPU_MMX - Intel MMX instruction set is available.
CPU_MMXPLUS - Intel MMX+ instruction set is available.
CPU_SSE - Intel SSE instruction set is available.
CPU_SSE2 - Intel SSE2 instruction set is available.
CPU_SSE3 - Intel SSE3 instruction set is available.
CPU_3DNOW - AMD 3DNow! instruction set is available.
CPU_ENH3DNOW - AMD Enhanced 3DNow! instruction set is
available.
CPU_CMOV - Pentium Pro "cmov" instruction is available.
You can check for multiple features by OR-ing the flags together. For example, to check if the CPU has an FPU and MMX instructions avail-
able, you'd do:
if ((cpu_capabilities & (CPU_FPU | CPU_MMX)) ==
(CPU_FPU | CPU_MMX)) {
printf("CPU has both an FPU and MMX instructions!
");
}
You can read this variable after you have called check_cpu() (which is automatically called by allegro_init()).
SEE ALSO check_cpu(3alleg4), cpu_vendor(3alleg4), cpu_family(3alleg4), cpu_model(3alleg4), cpu_capabilities(3alleg4), allegro_init(3alleg4)Allegro version 4.4.2 cpu_capabilities(3alleg4)