Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to know endianness of a machine Post 302700551 by Perderabo on Thursday 13th of September 2012 03:43:05 PM
Old 09-13-2012
We still some some Sparc systems, so I gave it a try...

First on Linux:
Code:
$ uname -is
Linux x86_64
$ perl -MConfig -e 'print "$Config{byteorder}\n";'
12345678
$ echo I | tr -d [:space:] | od -to2 | awk 'FNR==1{ print substr($2,6,1)}'
1
$ printf '\1' | od -dAn
     1
$

Now on Solaris:
Code:
$
$ uname -is
SunOS SUNW,Sun-Blade-1000
$ perl -MConfig -e 'print "$Config{byteorder}\n";'
87654321
$
$ echo I | tr -d [:space:] | od -to2 | awk 'FNR==1{ print substr($2,6,1)}'
$
$
$ echo I | tr -d [:space:] | od -to2 | nawk 'FNR==1{ print substr($2,6,1)}'
0
$ printf '\1' | od -dAn
         00256

$

I was surprised at first that the second one gave me trouble. Then I remembered that famous Solaris awk vs nawk thing and got it to work. My favorite is the perl line.
These 2 Users Gave Thanks to Perderabo For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

Best possible communication mechanism between a Solaris machine and a windows machine

hi, I have some windows client machines which require a signal to be sent by a Solaris machine( SunOS 5.6) when ever a particular event occurs on that Solaris machine. What are possible communication mechanisms by which i can do this. the constraints are > the windows machines have to... (7 Replies)
Discussion started by: Krsh
7 Replies

2. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

3. Solaris

Solaris 5.8 - BinaryFile - Endianness

Dear Users, How do I account for endian-ness while reading a Binary File generated from Solaris 5.8 (Sparc) on a Windows XP (x86) system. I just know that its a Binary File. I have no knowledge about the native datatype of the Binary File. (20 Replies)
Discussion started by: angshuman_ag
20 Replies

4. Shell Programming and Scripting

shell script to copy files frm a linux machine to a windows machine using SCP

I need a shell script to copy files frm a linux machine to a windows machine using SCP. The files keeps changing day-to-day. I have to copy the latest file to the windows machine frm the linux machine. for example :In Linux, On July 20, the file name will be 20.txt and it should be copied to... (3 Replies)
Discussion started by: nithin6034
3 Replies

5. Shell Programming and Scripting

How to transfer files from unix machine to local machine using shell script?

Hi All.. Am new to Unix!! Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp). And also i have to transfer the input file from the local directory to Unix machine (Server) Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies

6. UNIX for Advanced & Expert Users

FTP While transfering files to local machine to remote machine

Hi Am using unix Ksh Am getting the problem while transferring zero size files through the script . When i transfer zero size files from local machine to remote machine manually i can able to do it . My question its beause of zero size files am not able to transfer through script ? or its... (2 Replies)
Discussion started by: Venkatesh1
2 Replies

7. Linux

Unable to connect to Server machine from a client machine using ftp service

Hi, Could you please help me with the below issue.. I'm running RHEL6 OS on both server (192.168.0.10) and client machines (192.168.0.1). I'm trying to connect to server from the client machine using ftp service. I have installed vsftpd daemon on both the machines. I'm getting... (4 Replies)
Discussion started by: raosr020
4 Replies

8. Red Hat

iptables applied in local machine, can't ssh remote machine after chain changed to DROP

I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99 Source Destination was UP, with IP 192.168.1.15. This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
Discussion started by: babinlonston
2 Replies

9. Shell Programming and Scripting

Help with fetching the data from remote machine from my jumpbox(local machine)

Team, Presently i am running a script from my local box(i.e jumpbox) to all the remote machines.Basically fetching basic queries like pwd,mkdir,touch etc and i am able to successfully fetch it from my local machine.But when i want to check certain database related queries like the dbstat... (20 Replies)
Discussion started by: whizkidash
20 Replies

10. AIX

IBM TDS/SDS (LDAP) - can I mix endianness among servers in an instance ?

I'd like to add some x/linux-based servers to my current AIX-based TDS/SDS server community. Reading the Fine Install Guide (rtfig ?) I believe this may be covered by the section "Upgrade an instance of a previous version to a different computer" i.e. I'm going to install latest/greatest SDS on a... (4 Replies)
Discussion started by: maraixadm
4 Replies
mtext_case_compare(3m17n)					 The m17n Library					 mtext_case_compare(3m17n)

NAME
mtext_case_compare - Compare specified regions of two M-texts ignoring cases. SYNOPSIS
int mtext_case_compare (MText * mt1, int from1, int to1, MText * mt2, int from2, int to2) DESCRIPTION
Compare specified regions of two M-texts ignoring cases. The mtext_case_compare() function compares two M-texts mt1 and mt2, character-by-character, ignoring cases. The compared regions are between from1 and to1 in mt1 and from2 to to2 in MT2. from1 and from2 are inclusive, to1 and to2 are exclusive. from1 being equal to to1 (or from2 being equal to to2) means an M-text of length zero. An invalid region specification is regarded as both from1 and to1 (or from2 and to2) being 0. RETURN VALUE
This function returns 1, 0, or -1 if mt1 is found greater than, equal to, or less than mt2, respectively. Comparison is based on character codes. SEE ALSO
mtext_cmp(), mtext_ncmp(), mtext_casecmp(), mtext_ncasecmp(), mtext_compare() COPYRIGHT
Copyright (C) 2001 Information-technology Promotion Agency (IPA) Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST) Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>. Version 1.6.2 12 Jan 2011 mtext_case_compare(3m17n)
All times are GMT -4. The time now is 06:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy