Display shell online


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Display shell online
# 8  
Old 10-11-2010
Although /dev/random and /dev/urandom are not POSIX, they are both available on HPUX and AIX, so he might have it.
# 9  
Old 10-11-2010
$RANDOM does not exist in true Bourne Shell. It also does not exist in "csh" which could be more relevant to you.

If your normal shell is "csh" the "!#/bin/sh" syntax is valid but it goes off and starts a new Shell and then does nothing else. It does not execute the commands in the script after that line. When the "/bin/sh" session ends, it then continues with the next lines in the script but executes them in "csh" where $RANDOM is not valid.


Code:
The solution is to call a "sh" script from the "csh" script.

#!/bin/csh
# my_main_script.sh
/bin/sh my_sub_script.sh


#my_sub_script.sh
echo "${RANDOM}"

Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Server Staus offline to online -Shell script

Hi, We put cron entry :whenever server is offline(checks every 5 minutes) it sends status to mailer group. The number of messages (offline)were growing in our mailbox.How to avoid not to send offline messages after the first one through shell script. Thanks in advance. Chowdary (2 Replies)
Discussion started by: chowdary_m
2 Replies

2. UNIX for Dummies Questions & Answers

Online UNIX emulator for Korn Shell scripting

Hi, I am very new to UNIX and I wanted to know if there is any online UNIX emulator in which I can practice Korn shell scripting. I have internet access, but my machine's OS is Windows XP. I just had my UNIX fundamental class and wanted to practice some shell scripting. I am not in a position to... (1 Reply)
Discussion started by: eswasas
1 Replies

3. UNIX for Advanced & Expert Users

command for CPU online/offline status in bash shell

Hi , How do i check that the CPU is online/offline in a multi CPU machine in Linux ? i tired /proc/cpuinfo dmesg nothing gave me the currect CPU status. Pls help !! (5 Replies)
Discussion started by: sars
5 Replies

4. UNIX for Dummies Questions & Answers

how to display the shell type

hello, I was wondering what is the command to display the shell type? much thanks (3 Replies)
Discussion started by: yipster
3 Replies

5. Shell Programming and Scripting

Online/downloadable Shell Scripting book

Greetings All!! I am looking out for a comprehensive shell scripting book (unix & linux). I would request you to kindly post the links to get donwloadable/online books. I would prefer for the "Linux and Unix shell programming" by David Tansley. Any help will be highly appreciable. Cheers ... (5 Replies)
Discussion started by: arminder
5 Replies
Login or Register to Ask a Question