08-10-2016
I fail to see how this thread is fundamentally different from the 1st question in your first thread:
How to extract operand size in bits of a C program? nor why you believe that changing from an addition to a multiplication should cause a different answer than what you received in post #2 in that thread??? Is there some reason why you believe the answer I provided there is wrong?
I suppose if you really wanted to you could try to write a C language parser in a shell script to look for every multiplication operation in the C and assembler source files it is asked to process and instead of producing object code emits sizes of the types of the variables or constants being multiplied. And, if what you really want is the highest bit set in the results of each of those multiplications (as in the second question in your first thread), you would not only have to produce runnable object code, but also run them with real data and have your compiler add code to that object code that would print he highest bit set after each multiplication operation found in the source files you processed with your compiler.
I won't say it is impossible to do this, but shell is certainly not the language of choice for a project like this.
This User Gave Thanks to Don Cragun For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Let say there is a module fileselection module written in c language which returns the file name. Is it possible to get the file name from the file selection module directly, I mean can we call a c function directly in shell script without doing executable. If possible then how it can be... (1 Reply)
Discussion started by: surjyap
1 Replies
2. Shell Programming and Scripting
Dear Friends,
I am on SOLARIS 9 (ksh)
I am working on a shell script that upload files with NcFTP with resume option. So far the script is working correctly. The script makes a list of files that need to be transferred and then launch the NcFTP command to start the transfer.
... (0 Replies)
Discussion started by: Aswex
0 Replies
3. Shell Programming and Scripting
This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord
but only one record is getting wrote in DB.... Please advise ASAP...:confused:
function InsertFtg
{
FTGSTR=""
echo "Saurabh is GREAT $#"
let... (2 Replies)
Discussion started by: omkar.sonawane
2 Replies
4. Shell Programming and Scripting
How to connect to db2 through shell script using cygwin? (0 Replies)
Discussion started by: supriyat
0 Replies
5. Red Hat
please help me in this script
shell script :1
***********
>cat file1.sh
#!/bin/bash
echo "this is first file"
function var()
{
a=10
b=11
}
function var_1()
{
c=12
d=13 (2 Replies)
Discussion started by: ponmuthu
2 Replies
6. Shell Programming and Scripting
I've 2 shell scripts viz., CmnFuncs.ksh and myScript.ksh.
1st script contains all common functions and its code is as below:
$vi CmnFuncs.ksh
#!/bin/ksh
RunDate()
{
....
....
export Rundt=`date +%Y%m%d`
}
2nd script is invoking the above one and I expect to use the RunDt variable... (8 Replies)
Discussion started by: njny
8 Replies
7. Shell Programming and Scripting
Hi Team -
I"m very new to Shell Scripting so I have a rather novice question. My forte is Windows Batch Scripting so I was just wondering what the Shell Script equivalent is to the DOS command %~n?
%~n is a DOS variable that dispayed the script name.
For instance (in DOS):
REM... (11 Replies)
Discussion started by: SIMMS7400
11 Replies
8. Shell Programming and Scripting
The file starts like this:
Directory: <path to the script>
Script: <script fife name>
#!bin/ksh
##Comments
<actual script>
What is the use of the first two lines in the script? What if I save the file without them? What will be the effect? They are not comments. Im very new to this,... (4 Replies)
Discussion started by: remytom
4 Replies
9. Shell Programming and Scripting
local script:
cat > first.sh
cd /tmp
echo $PWD
echo `whoami`
cd /tmp/123
tar -cvf 789.tar 456
sleep 10
except script:
cat > first
#!/usr/bin/expect
set ip 10.5.15.20
set user "xyz123"
set password "123456"
set script first.sh
spawn sh -c "ssh $user@$ip bash < $script" (1 Reply)
Discussion started by: Aditya Avanth
1 Replies
10. Shell Programming and Scripting
I want to make a config file which contain all the paths.
i want to read the config file line by line and pass as an argument on my below function.
Replace all the path with reading config path line by line and pass in respective functions.
how can i achieve that?
Kindly guide.
... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
LEARN ABOUT OSF1
pthread_setname_np
pthread_setname_np(3) Library Functions Manual pthread_setname_np(3)
NAME
pthread_setname_np - Changes the object name in the thread object for an existing thread.
LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so)
SYNOPSIS
#include <pthread.h>
int pthread_setname_np(
pthread_thread_t thread,
const char *name,
void *mbz);
PARAMETERS
Thread object whose object name is to be changed. Object name value to copy into the thread object. Reserved for future use. The value
must be zero (0).
DESCRIPTION
This routine changes the object name in the thread object specified by thread to the value specified by name. To set an existing thread's
object name, call this routine after creating the thread. However, with this approach your program must account for the possibility that
the target thread has already exited or has been canceled before this routine is called.
The object name is a C language string and provides an identifier that is meaningful to a person debugging a DECthreads-based multithreaded
application. The maximum number of characters in the object name is 31.
This routine contrasts with pthread_attr_setname_np, which changes the object name attribute in a thread attributes object that is used to
create a new thread.
RETURN VALUES
If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows:
Successful completion. The thread specified by thread does not exist. The length in characters of name exceeds 31. Insufficient memory
exists to create a copy of the object name string.
ERRORS
None
RELATED INFORMATION
Functions: pthread_getname_np(3), pthread_attr_setname_np(3)
Manuals: Guide to DECthreads and Programmer's Guide
delim off
pthread_setname_np(3)