Sponsored Content
Top Forums UNIX for Dummies Questions & Answers this cshell script does not work ?? Post 302597597 by kaaliakahn on Friday 10th of February 2012 05:47:58 PM
Old 02-10-2012
this cshell script does not work ??

Hi I am trying to put the following commands that i have to type manually at the cshell prompt into a cshell script startup.csh which is copied below


echo $DISPLAY
xhost +
rsh ba08lo01
module load incisiv/102/10.20.035
setenv DISPLAY $DISPLAY


When i run the script with source command as follows

$ source startup.csh


I get the following messages on the cshell

ba08ut01:12:0 #this is the output of first command
access control disabled,clients can connect from any host #output of 2nd command
Last Login Sat, Feb 11, 04:01:22 from ba08ut01 #output of last command


I am wondering why lines 3 and 4 are not getting executed in the startup.csh script. If i type these commands on the command prompt, i see them executing and the messages they print out to the screen.

Is there some thing wrong with the syntax?

Please correct me.

Do i have to modify it a lot in case i want to convert it to bash script.

Thanks a lot for your attention

Hats off to Corona688 for his earlier help.

Last edited by kaaliakahn; 02-10-2012 at 07:13 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help with cshell script to read 1 or more lex files

taskes one or more .l files and compiles them #!/usr/bin/csh #while loop to carry on asking user to enter the files while $number!=0 echo "enter file name" #check to see if file ends with .l #if file ends with .l compile lexx.yy.c file for each file this is how i think it needs... (1 Reply)
Discussion started by: homerj546
1 Replies

2. Shell Programming and Scripting

How to make a cshell (csh) script interactive

Experts, I tried to make my cshell script interactive by asking the user for password and trying to read the input using the "read" command. I have been unsuccessful so far. Do you have any idea ? Thanks Jim (2 Replies)
Discussion started by: jimmynath
2 Replies

3. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

4. Shell Programming and Scripting

Modify Perl script to work with txt - Permissions script

Hi I have this code, and i want work with a ls -shalR output in .txt What i need read to do this?? Where start? #!/usr/bin/perl # Allrights- A perl tool for making backups of file permissions # Copyright (C) 2005 Norbert Klein <norbert@acodedb.com> # This program is free... (1 Reply)
Discussion started by: joangopan
1 Replies

5. UNIX for Dummies Questions & Answers

Regarding Decimals in Cshell

Hello... I am new to unix and I am wondering if in a C-shell script , Are we supposed to use only whole numbers........ for example..if a program needs to calculate the average of some numbers........ @ avg = (($1 +$2 + $3)/3)) is returning a whole number.........How can a decimal be achieved... (1 Reply)
Discussion started by: ravindra22
1 Replies

6. Shell Programming and Scripting

Script cShell - help!!

Hello everyone! i'm new in this forum and I'm here because I have a huge problem with a csh script. Here the problem: I have to write a script that check the system status, more precisely I have to check if there are processes with TIME > 3 hours and if such processes exists I must send a mail... (3 Replies)
Discussion started by: TheBeefEater
3 Replies

7. Shell Programming and Scripting

cshell script problem

Hi ,I have this simple code,why is not working thanks #!/bin/csh set res=find ./ -name "*.bash" | wc -l $res > result.txt (16 Replies)
Discussion started by: lio123
16 Replies

8. UNIX for Advanced & Expert Users

Unable to call a script from another script in cshell

Hi, I am unable to call one script from another script in c shell on windows SUA environment. Please find below code , File1 āTmp.csh: #!/bin/csh setenv PATH "${PATH}:.:$TOP/bin:$TOP/RMBIN/bin:$GP_SUA/:$INTERIX_ROOT" echo "hi1" . /tmp1.csh File2ātmp1.csh ... (6 Replies)
Discussion started by: gthangav
6 Replies

9. Shell Programming and Scripting

My script work on Linux but not work in sunos.

My script work on Linux but not work in sun os. my script. logFiles="sentLog1.log sentLog2.log" intial_time="0 0" logLocation="/usr/local/tomcat/logs/" sleepTime=600 failMessage=":: $(tput bold)Log not update$(tput rmso) = " successMessage="OK" arr=($logFiles)... (7 Replies)
Discussion started by: ooilinlove
7 Replies

10. Shell Programming and Scripting

Assigning any number to the variable in cshell script

Hello Guys, I would like to ask you for a favor. Could you please help me how can I assign any number as the parameter to a, from stdin (-c), in the following command line by using the 'switch' in a script? awk '$8>a {print "File name:" $5,$8}' I would also appreciate if you can share any... (1 Reply)
Discussion started by: Padavan
1 Replies
shell_builtins(1)														 shell_builtins(1)

NAME
shell_builtins, case, for, foreach, function, if, repeat, select, switch, until, while - shell command interpreter built-in commands The shell command interpreters csh(1), ksh(1), and sh(1) have special built-in commands. The commands case, for, foreach, function, if, repeat, select, switch, until, and while are commands in the syntax recognized by the shells. They are described in the Commands section of the manual pages of the respective shells. The remaining commands listed in the table below are built into the shells for reasons such as efficiency or data sharing between command invocations. They are described on their respective manual pages. | Command | Shell alias |csh, ksh bg |csh, ksh, sh break |csh, ksh, sh case |csh, ksh, sh cd |csh, ksh, sh chdir |csh, sh continue |csh, ksh, sh dirs |csh echo |csh, ksh, sh eval |csh, ksh, sh exec |csh, ksh, sh exit |csh, ksh, sh export |ksh, sh false |ksh fc |ksh fg |csh, ksh, sh for |ksh, sh foreach |csh function |ksh getopts |ksh, sh glob |csh goto |csh hash |ksh, sh hashstat |csh history |csh if |csh, ksh, sh jobs |csh, ksh, sh kill |csh, ksh, sh let |ksh limit |csh login |csh, ksh, sh logout |csh, ksh, sh nice |csh newgrp |ksh, sh nohup |csh notify |csh onintr |csh popd |csh print |ksh pushd |csh pwd |ksh, sh read |ksh, sh readonly |ksh, sh rehash |csh repeat |csh return |ksh, sh select |ksh set |csh, ksh, sh setenv |csh shift |csh, ksh, sh source |csh stop |csh, ksh, sh suspend |csh, ksh, sh switch |csh test |ksh, sh time |csh times |ksh, sh trap |ksh, sh true |ksh type |ksh, sh typeset |ksh ulimit |ksh, sh umask |csh, ksh, sh unalias |csh, ksh unhash |csh unlimit |csh unset |csh, ksh, sh unsetenv |csh until |ksh, sh wait |csh, ksh, sh whence |ksh while |csh, ksh, sh Bourne Shell, sh, Special Commands Input/output redirection is now permitted for these commands. File descriptor 1 is the default output location. When Job Control is enabled, additional Special Commands are added to the shell's environment. In addition to these built-in reserved command words, sh also uses: : No effect; the command does nothing. A zero exit code is returned. .filename Read and execute commands from filename and return. The search path specified by PATH is used to find the directory con- taining filename. C shell, csh Built-in commands are executed within the C shell. If a built-in command occurs as any component of a pipeline except the last, it is exe- cuted in a subshell. In addition to these built-in reserved command words, csh also uses: : Null command. This command is interpreted, but performs no action. Korn Shell, ksh, Special Commands Input/Output redirection is permitted. Unless otherwise indicated, the output is written on file descriptor 1 and the exit status, when there is no syntax error, is zero. Commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. In addition to these built-in reserved command words, ksh also uses: * : [ arg ... ] The command only expands parameters. * .file [ arg ..Read the complete file then execute the commands. The commands are executed in the current shell environment. The search path specified by PATH is used to find the directory containing file. If any arguments arg are given, they become the posi- tional parameters. Otherwise, the positional parameters are unchanged. The exit status is the exit status of the last com- mand executed. the loop termination test. intro(1), alias(1), break(1), cd(1), chmod(1), csh(1), echo(1), exec(1), exit(1), find(1), getoptcvt(1), getopts(1), glob(1), hash(1), his- tory(1), jobs(1), kill(1), ksh(1), let(1), limit(1), login(1), logout(1), newgrp(1), nice(1), nohup(1), print(1), pwd(1), read(1), read- only(1), set(1), sh(1), shift(1), suspend(1), test(1B), time(1), times(1), trap(1), typeset(1), umask(1), wait(1), chdir(2), chmod(2), creat(2), umask(2), getopt(3C), profile(4), environ(5) 29 Jun 2005 shell_builtins(1)
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy