First steps script
Hi guys,
I'm getting an error in line 3: Quote:
I've tried all kinds of combination in that line, none work. Thanks, Joel |
Code:
if [ -w $file]; then google conditional shell script http://www.dreamsyssoft.com/sp_ifelse.jsp edit:I misinterpreted what you wanted. I thought you meant command 3... Anyway google user input shell script. You want the read command. http://unixhelp.ed.ac.uk/scrpt/scrpt2.3.html |
Thanks sag,
it tells that there is something wrong in line 3 Quote:
thanks, Joel |
Actually you mixed syntax of C-shell and Bourne shell. $< is valid only in C-shells and it's replaced by the next line of standard input. Here are two versions of the same script, one in tcsh, the other in bash. Please, check the differences:
Code:
#!/bin/tcsh Code:
#!/bin/bash |
Hi Joel
What are you expecting that line to do? Edit: Beaten by the master again ... lol |
It works!
Thank you all! I just had the wrong shell (like you said):hattip: It doesn't work with /bin/sh but does with /bin/csh :doh: |
All times are GMT -5. The time now is 10:48 AM. |