Running shell script on Fedora core
Hello Friends,
I have installed Fedora core 6 and tring to run some shell scripts but it didn't give any result. I am confused !!! Here is my test script, set var = net echo $var After I run the script it didn't show any output. defauslt shell for the login is tcsh and .zshrc file as follows, # # .zshrc is sourced in interactive shells. # It should contain commands to set up aliases, # functions, options, key bindings, etc. # autoload -U compinit compinit #allow tab completion in the middle of a word setopt COMPLETE_IN_WORD ## keep background processes at full speed #setopt NOBGNICE ## restart running processes on exit #setopt HUP ## history #setopt APPEND_HISTORY ## for sharing history between zsh processes #setopt INC_APPEND_HISTORY #setopt SHARE_HISTORY ## never ever beep ever #setopt NO_BEEP ## automatically decide when to page a list of completions #LISTMAX=0 ## disable mail checking #MAILCHECK=0 # autoload -U colors #colors Any body have any idea about this ? Mahesh |
Try:
Code:
#!/bin/bash Code:
chmod 755 <scriptname> |
Please paste code extracts in [code] tags (in the advanced mode of the forums post editor, you can just highlight the text and click the # button). It makes it a lot easier to read won't wrap lines confusingly like non-code tags does.
.zshrc is not touched by tcsh, so that can safely be ignored. See the FILES section of the tcsh manpage for a full list of files which tcsh uses. Please post the full contents of the script file, and do ls -l on it, and show how you are executing it, e.g. if the script file is called "test.sh", do this and post the results here (inside [code] tags!): Code:
chubby:~/tmp> ls -l test.sh |
Ok I created the .cshrc see below, but still I cat see any result out put.
Code:
# Code:
Thanks |
Show me how you are executing it, and what the output is. After running it, do this too:
Code:
ls -l test1 |
Here is the output,
Code:
[ppscdr@cdrwebserver ~]$ sh dircreater.sh |
Don't run it like this. What you're doing is telling the borne shell, sh, to process the file, which is written with the csh syntax. It's something like telling a python interpreter to run a perl program.
You could execute in one of the following ways:
|
Ok. I understod, but why it dosen't show the echo out put.
|
Quote:
Code:
variablename=value |
Thanks for the help.
:) |
All times are GMT -5. The time now is 04:21 AM. |