The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Executing a shell script from windows;script present in unix rajneesh_kapoor UNIX for Advanced & Expert Users 4 05-08-2009 02:54 PM
(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script praka Shell Programming and Scripting 6 04-15-2009 06:09 AM
need inputs on how i can change my script to reduce amount of time the script takes madhul2002 Shell Programming and Scripting 1 04-01-2009 07:40 PM
create a shell script that calls another script and and an awk script magikminox Shell Programming and Scripting 0 06-26-2008 02:50 AM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 03:06 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-12-2009
tkidd tkidd is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 2
help with ftp script

Hello,
I am trying to automate an ftp process, but the password contains a dollar sign $. How can I keep that $ symbol from being misintepreted by the shell script? I created a simple test script.
#!/bin/sh -x
password="test$pwd"
echo $password

Here is the output.
+ password=test
+ echo test
test

Thank you in advance...
  #2 (permalink)  
Old 06-12-2009
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,574
Have you tried "test\$pwd" ?

-----Post Update-----

Why dont you use a .netrc file?
  #3 (permalink)  
Old 06-12-2009
tkidd tkidd is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 2
Thank you for the quick reply! That did the trick!
#!/bin/sh -x
password="test\$pwd"
echo $password

Here is the output
+ password=test$pwd
+ echo test$pwd
test$pwd
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:44 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0