LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-15-2004, 04:02 PM   #1
perothman
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Rep: Reputation: 0
What ftp command will change you to $HOME or ~


I am trying to create some generic scripts for ftping files that work both on AIX and Linux. On AIX, when your in ftp, you can still change to ~ or $HOME just like you would if you weren't in ftp. While these command work on Linux, they don't seem to work on Linux when you're in ftp. Any suggestions?
 
Old 04-15-2004, 04:05 PM   #2
Mr.Bill.Gates
Member
 
Registered: Apr 2004
Location: Moscow, Russia
Distribution: Debian
Posts: 55

Rep: Reputation: 15
cd when outside ftp client (in the shell)
lcd when incide ftp

that is "local cd"
 
Old 04-15-2004, 04:19 PM   #3
perothman
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Sorry, I didn't do a very good job of really explaining what I need. I need to be able to change into a subdirectory in $HOME, but $HOME doesn't always have the same name on every box. I want to distribute software to a directory called common directory on a box, and if the common directory doesn't exist, I want to create it. This has to work regardless of the name of the home directory. For example. The script that is doing ftp spools to a file on the source server. It does a cd ~/common. It checks the error in the log file on the source server to find out if the directory existed or not. If it doesn't, it will create it with mkdir ~/common. By doing this, I can reduce the number of times I have to change directories. I'm currently using the code on sun and iax, but I can't get it to work on linux. That's why I need something at implies $HOME in ftp.
 
Old 04-15-2004, 09:59 PM   #4
chuck2
Member
 
Registered: Apr 2003
Location: im poor i live in philly
Distribution: slackware 9.1
Posts: 34

Rep: Reputation: 15
do you mean like 'cd $h '?
 
Old 04-16-2004, 05:03 PM   #5
perothman
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Original Poster
Rep: Reputation: 0
What I need is a variable or alias that substitues from $HOME while using ftp. I want to be able to create subdirectories without fully qualifying or changing to the parent directory. For example. if $HOME is equal to /u01/app/oracle and I'm in /tmp and I want to create a directory in /u01/app/oracle called common. I want to do mkdir $HOME/common or ~/common. I don't want to have to type in /u01/app/oracle because the path is not the same on all of our boxes, and to save time, I don't want to do a lot of directory switching. We have some that are /u101/app/oracle and some that are /u01/app/oracle, they are both $HOME on one or more boxes. I'm trying to create a generic script that can build directory structures on any of our boxes and because the naming conventions are not the same, I need something symbolic to represent $HOME during the ftp process.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 02:37 PM
want to ssh/ftp to home machine (Slack) from office through home router fincher69 Linux - Networking 2 09-21-2005 10:55 PM
what is different with Ftp From browser and Ftp from command line zahra79 Linux - Networking 2 06-22-2005 03:26 AM
How to change the home? x5452 Linux - General 2 04-15-2004 08:19 AM
Did @HOME change its setup? tarballedtux Linux - Networking 0 02-09-2002 09:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration