c shell instead of bash


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting c shell instead of bash
# 1  
Old 03-18-2008
c shell instead of bash

(reposting this with a better title)

Cool. I played with scripts at home over the weekend. Come to find out not working on other shells. I have linux/bash at home, but now I'm trying on Solaris csh.

How would I write the following script for Solaris C shell?
----------

#!/bin/bash
NBR=231
for ((i = 0; i < $NBR; i++ ))
do
printf "0 | 0 | $i |key$i$i |\n" >> printi.txt
done
exit

----------

Ok maybe I should just search it myself, but asking this way is so much lazier and faster! :-)
thank you so much
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed ? Is there any way to get the script names for the process command ? --- Post updated at 08:39 AM --- in KSH (Korn Shell), my command output shows the script names but when run in the Bash Shell... (3 Replies)
Discussion started by: i4ismail
3 Replies

2. Shell Programming and Scripting

Different behavior between bash shell and bash script for cmd

So I'm trying to pass certain json elements as env vars and use them later on in a script. Sample json: JSON='{ "Element1": "file-123456", "Element2": "Name, of, company written in, a very weird way", "Element3": "path/to/some/file.txt", }' (part of the) script: for s... (5 Replies)
Discussion started by: da1
5 Replies

3. UNIX for Dummies Questions & Answers

Which of the following command displays your login shell in bash shell?

Options:: A)$shell B)echo $ bash C)echo $ O D)$ O (1 Reply)
Discussion started by: raghugowda
1 Replies

4. Shell Programming and Scripting

Bash vs shell

hi i am having my code ,which call a funtion under a given condition in a case statement as below error() { echo "Do you want to enter PO again(Y/N):" read answer case "$answer" in Y) main ;; y) main ;; N) exit ;; n) exit ;; *) ;; esac } if i run the prog with bash filename ,the... (4 Replies)
Discussion started by: mohanalakshmi
4 Replies

5. Shell Programming and Scripting

I need to understand the differences between the bash shell and the Bourne shell

I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done. I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Discussion started by: awk_sed_hello
7 Replies

6. Shell Programming and Scripting

bash shell

#!/bin/bash declare -a dirs index=0 for dir in `ls -d */` do dirs=$dir echo $index. $dir index=`expr $index + 1` done Its giving me distorted output: c.sh: dirs=1/: No such file or directory 0. 1/ c.sh: dirs=11844/: No such file or directory 1. 11844/ c.sh: dirs=12819/: No such... (3 Replies)
Discussion started by: uunniixx
3 Replies

7. Shell Programming and Scripting

Bash Shell to sh Shell In a Script

Hi All, I am in Bash Shell and Running A script that contains Exit statement in that in last ( to return to sh shell after executing) But it is not coming to sh shell after the script is excuted. How to return to sh shell from bash shell through a script. (8 Replies)
Discussion started by: saurabh84g
8 Replies

8. Shell Programming and Scripting

Run a C Shell using only Bash shell

Hi, I have only bash on my system. And I want to run a C shell... Is there a way for that? (3 Replies)
Discussion started by: HSN
3 Replies

9. Linux

Bash Shell

How do i get rid of those blue & other colors in bash, i just want to have the text all the same, I use PuTTY and the colors up against my black backdrop and green test does not go well/ (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

10. Shell Programming and Scripting

Bash shell ...

Hi All, I am using HP-UX. Here ksh is configured as a default shell. How can i change this to bash. And please let me know of any freely available X-Terminals through which i can connect to Unix system from Windows. Regards, Vijay Hegde (2 Replies)
Discussion started by: VijayHegde
2 Replies
Login or Register to Ask a Question
SYSLOGOUT(8)						      System Manager's Manual						      SYSLOGOUT(8)

NAME
syslogout - modular centralized shell logout mechanism DESCRIPTION
syslogout is a generic approach to enable centralized shell logout actions for all users of a given system in a modular and centralized way mostly aimed at avoiding work for lazy sysadmins. It has only been tested to work with the bash shell. It basically consists of the small /etc/syslogout shell script which invokes other small shell scripts having a .bash suffix which are con- tained in the /etc/syslogout.d/ directory. The system administrator can drop in any script he wants without any naming convention other than that the scripts need to have a .bash suffix to enable automagic sourcing by the /etc/syslogout script. For shell sessions, the contents of /etc/syslogout.d/" will be sourced by every user at logout if the following lines are present in his $HOME/.bash_logout: if [ -f /etc/syslogout ]; then . /etc/syslogout fi If used for X sessions it is advisable to include the former statement into the Xreset script of the X display manager instead to prevent that closing of an terminal emulator window yields unexpected results in your running X session if your X11 terminal emulator is using a login shell. Be sure then to run it under the user-id of the X session's user. See the example files in /usr/share/doc/syslogout/ for illustration. Users not wanting /etc/syslogout to be sourced for their environment can easily disable it's automatic mechanism. It can be disabled by simply creating an empty file called $HOME/.nosyslogout in the user's home directory using e.g. the touch(1) command. Any single configuration file in /etc/syslogout.d/ can simply be overridden by any user by creating a private $HOME/.syslogout.d/ directory which may contain a user's own version of any configuration file to be sourced instead of the system default. It's names have just to match exactly the system's default /etc/syslogout.d/ configuration files. Empty versions of these files contained in the $HOME/.syslo- gout.d/ directory automatically disable sourcing of the system wide version. Naturally, users can add and include their own private scripts to be automagically executed by /etc/syslogout at logout time. OPTIONS
There are no options other than those dictated by shell conventions. Anything is defined within the configuration scripts themselves. SEE ALSO
The README files and configuration examples contained in /usr/share/doc/syslogout/ and the manual page for bash(1), xdm(1x), xdm.options(5), and wdm(1x). Recommended further reading is everything related with shell programming. If you need a similar mechanism for executing code at login time check out the related package sysprofile(8) which is a very close compan- ion to syslogout. BUGS
syslogout in its current form is mainly restricted to bash(1) syntax. In fact it is actually a rather embarrassing quick and dirty hack than anything else - but it works. It serves the practical need to enable a centralized bash configuration until something better becomes available. Your constructive criticism in making this into something better" is very welcome. Before i forget to mention it: we take patches... ;-) AUTHOR
syslogout was developed by Paul Seelig <pseelig@debian.org> specifically for the Debian GNU/Linux system. Feel free to port it to and use it anywhere else under the conditions of either the GNU public license or the BSD license or both. Better yet, please help to make it into something more worthwhile than it currently is. SYSLOGOUT(8)