Re: Bash Understanding - Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/2/06, Dan Track <dan.track@xxxxxxxxx> wrote:
Hi

I've got this little script and to run the commands I copy the
commands into my paste buffer by selecting the lines. The script was
opened in vi.

The script contains some parts that require manual intervention so for
example I would have:

cd /opt
mkdir java
scp -rp server:/opt/java/java* java/
cd java
ls

If I paste the above to a shell it will run all the way up until the
"scp" command. After completing the scp command the shell returms me
to a prompt. The rest of the script isn't run. Can someone please
explain why this is happening?

Thanks in advance
Dan

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list


I just tried the following and it works here:

cd scripts;mkdir temp;scp -rp localhost:/home/myusername/images/*
temp; cd temp;ls

It properly did a cd to the scripts folder that was within the pwd at
the time the script ran.  It then did the scp no problem, then the cd
to the temp folder, and finally the ls.  I am assuming that is what
you mean by running the commands from the shell, with a semi-colon
between each command.

Is there any manual intervention required in that part of the script,
or are the options coded in that part of the script?  Also  any reason
why you'd do a cd to the folder, create a sub-folder, then copy, then
cd to the sub-folder, then list it - instead of mkdir /opt/java (no
need to cd to it first) followed by scp -rp server:/opt/java/java*
/opt/java/ and finally followed by ls /opt/java?

Not a big deal either way.  Just cuts out the change directory
commands.  If you need to refer to relative paths, use the . and the
.. within your scp or your ls command rather than doing a cd.

For debugging you could try the -v option with the scp and see if that
provides you with anything helpful.  Or for greater debugging you
could prefix the scp with the strace command.

Sorry I'm not more help than that.  I'd be curious to find out the
reason should you figure it out.

Thanks,

Jacques B.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux