Sponsored Content
Top Forums Shell Programming and Scripting portability issue linux(2.6) solaris10 Post 302203520 by joepareti on Monday 9th of June 2008 04:22:00 AM
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...]
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
SULOGIN(8)						       System Administration							SULOGIN(8)

NAME
sulogin - Single-user login SYNOPSIS
sulogin [options] [tty] DESCRIPTION
sulogin is invoked by init when the system goes into single user mode. The user is prompted: Give root password for system maintenance (or type Control-D for normal startup): sulogin will be connected to the current terminal, or to the optional tty device that can be specified on the command line (typically /dev/console). After the user exits the single-user shell or presses control-D at the prompt, the system will continue to boot. OPTIONS
-e, --force If the default method of obtaining the root password via getpwnam(3) from the system fails, manually examine /etc/passwd and /etc/shadow to get the password. If they are damaged or nonexistent, sulogin will start a root shell without asking for a password. Only use the -e option if you are sure the console is physically protected against unauthorized access. -p, --login-shell Specifying this option causes sulogin to start the shell process as a login shell. -t, --timeout seconds Specify the maximum amount of time to wait for user input. By default, sulogin will wait forever. -h, --help Print a help message. -V, --version Output version. ENVIRONMENT VARIABLES
sulogin looks for the environment variable SUSHELL or sushell to determine what shell to start. If the environment variable is not set, it will try to execute root's shell from /etc/passwd. If that fails it will fall back to /bin/sh. AUTHOR
sulogin was written by Miquel van Smoorenburg for sysvinit and later ported to util-linux by Dave Reisner and Karel Zak. AVAILABILITY
The sulogin command is part of the util-linux package and is available from Linux Kernel Archive <ftp://ftp.kernel.org/pub/linux/utils /util-linux/>. util-linux Jul 2012 SULOGIN(8)
All times are GMT -4. The time now is 02:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy