Re: problems faced while using ssh



On Tue, Dec 12, 2006 at 10:10:43PM -0800, kknegi wrote:
C:\>ssh shadm@xxxxxxxxxxxxxxxxxxx /home/shadm/shcalc/DateProject/test.sh >
test1.log

What does this script look like?

grep: can't open rates.rel

You realize that the script will be executed with its working directory
set to shadm's $HOME, correct?

expr: Syntax error

Most likely, you forgot to quote something properly. In general, I
abhor the use of expr(1) in shell scripts. Its only real purpose is
in writing legacy (pre-POSIX, pre-ksh) Bourne shell scripts. There
are shell builtins that can do almost everything expr does, but faster
and cleaner.

grep: can't open canada_exchange_rate.txt
grep: can't open month_midmonth_release.txt
sed: Cannot find or open file month_midmonth_release.txt.

I think the fact that you're sitting in $HOME instead of wherever you
expected to be is the most likely candidate for all three of these.

Is there something to do with SSH permissions????

Sounds more like you need a few pointers in writing shell scripts.



Relevant Pages

  • ntlib.cmd (Advanced NT/2K/XP/K3 Command Library)
    ... The latest Advanced Command Library for Windows NT/2K/XP/K3 ... MAINTAINABLE shell scripts without adding any third-party software. ... They are constructed entirely of builtin commands ...
    (microsoft.public.win2000.cmdprompt.admin)
  • ntlib.cmd (Advanced NT/2K/XP/K3 Command Library)
    ... The latest Advanced Command Library for Windows NT/2K/XP/K3 ... MAINTAINABLE shell scripts without adding any third-party software. ... They are constructed entirely of builtin commands ...
    (microsoft.public.win32.programmer.tools)
  • Re: bash compiler
    ... there is a compiler for bash, ... and free, true and fake, compilers for shell scripts: ... "Timing Trials, or, the Trials of Timing: ...
    (comp.unix.shell)
  • Re: is tcl a reasonable alternative to unix shell scripts?
    ... simple lisp-like syntax of tcl appeals to me. ... simpler and/or more readable than shell scripts for writing simple ... unless you're on a system where the regular unix commands ...
    (comp.lang.tcl)
  • Re: [PATCH] Linux 2.6: shebang handling in fs/binfmt_script.c
    ... > shell scripts with the name of the shell script file in the error ... Look and see how they are getting that script file name. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)