portability issue linux(2.6) solaris10


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting portability issue linux(2.6) solaris10
# 1  
Old 06-09-2008
portability issue linux(2.6) solaris10

the following simple scripts work fine on linux but fail on solaris:

#!/bin/bash
eval /usr/bin/time -f \'bt=\"%U + %S\"\' ./JUNK >> ./LOG 2>&1
cp ./LOG ./LOG_joe
LC_joe=`cat ./LOG | wc -l`
LC_joe=`echo $LC_joe-1|bc`
tail -1 ./LOG > ./tmp
head -$LC_joe ./LOG_joe > ./LOG
rm ./LOG_joe

where JUNK is:
#!/bin/bash
#sleep 9
gzip junk.tar
echo This is the app
hostname
#junk.tar size 805058560

The output files on linux are:$cat LOG
This is the app
localhost.localdomain

$cat tmp
bt="75.12 + 1.99"


The output files on solaris are:
$cat LOG
/usr/bin/time: illegal option -- f
$cat tmp
usage: time [-p] utility [argument...]
# 2  
Old 06-09-2008
it seems the -f option is not supported in the Solaris time command. You could try and download the GNU version and make sure the script uses it

or you could make a uname and some if statements to get around the different behaviors of solaris / Linux.

/p
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Veritas I/O fencing issue on Solaris10

I have 2 clusters running on solaris10 servers. VCS is working fine but when i configure I/O fencing with co-ordinated disks only one node have the keys on the disks at time where as both the nodes shuld have keys there what could be the reason for this ? like in the following o/p only Node2's... (0 Replies)
Discussion started by: fugitive
0 Replies

2. Solaris

VNC issue on solaris10

M running solaris 10 u8 my vncserver is running on :0 .. and when i try to connect it through tight vncview i can see just see the screen .. with no terminal .. what could be the issue for it ? and what i need to check for it ? (2 Replies)
Discussion started by: fugitive
2 Replies

3. Solaris

Swap issue on a Solaris10 box

One of our system is running 3 oracle db instances. And as per prstat o/p the system is approximately using 78G of swap memory # prstat -J -n 2,15 PROJID NPROC SWAP RSS MEMORY TIME CPU PROJECT 4038 557 31G 29G 22% 113:23:43 10% proj1 4036 466 20G 19G... (2 Replies)
Discussion started by: fugitive
2 Replies

4. Solaris

/tmp issue on solaris10 box

I have a T5240 server with following swap configuration $ grep tmp /etc/vfstab swap - /tmp tmpfs - yes - $ swap -l swapfile dev swaplo blocks free /dev/swap 4294967295,4294967295 16 213909472 213909472 ... (4 Replies)
Discussion started by: fugitive
4 Replies

5. Solaris

Memory issue on solaris10 box

my system has 128G of installed memory. top, vmstat shows the system has just over 10G of free memory on the system. but as per prstat o/p the usage is just 50-55G is there anyway i can find which process/zone is using more memory ? System has 3 zones and all running application servers. ... (1 Reply)
Discussion started by: fugitive
1 Replies

6. UNIX for Dummies Questions & Answers

portability of int arrays from 32 to 64 bit systems

Dear All, I'm porting my scientific program from 32 to 64 bit system (use gcc, CentOS) and feel myself absolutely confused after reading general internet advices for that. Could you help me, please. The question is: can I use "old style" on 64 bit: -------- int * myIntArray; ... (3 Replies)
Discussion started by: German1234
3 Replies

7. Shell Programming and Scripting

Script Portability

Hi, I am writing a BASH shell script for a client. I am using BASH on a Macintosh Powerbook G4 running Leopard. My client will be using BASH on a PC running Ubuntu. My questions all revolve around making my script portable so that it will run on his machine. - Do I need to get any other... (2 Replies)
Discussion started by: msb65
2 Replies

8. UNIX for Dummies Questions & Answers

Script portability

Hello, May I the right place if I need competencies to migrate DOS script into Unix platforme? Thanks in advance Thierry (9 Replies)
Discussion started by: tsconetti
9 Replies

9. Programming

A C program required for portability

I have to solve a problem for my wife who is engaged in Research in Breast Cancer. 1. She has frequently to search a long single line of alphabetic characters (lower case) for an exact match of a string. e.g.... (1 Reply)
Discussion started by: nmsinghe
1 Replies
Login or Register to Ask a Question