Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Syntax Question

BellaBella Member
edited August 2014 in Help

I'm still a newbie at this.

I have a file called setup.sh

ipaddr=curl getipaddr.net -s | head -n 1

secret=''blah"

radiusip='YOURRADIUSIPHERE'

echo "$radiusip $secret" >> /etc/ppp/options.pptpd

What I want it to do is add

11.55.22.66 blah to /etc/ppp/options.pptpd

But what ends up happening is it adds

$radiusip $secret

instead of the actual value of those variables.

Can someone help me.

Comments

  • I can tell you that

     ipaddr=curl getipaddr.net -s | head -n 1 

    should be

     ipaddr=`curl getipaddr.net -s | head -n 1` 

    The ticks puts the results of that command into the variable ipaddr.

    #!/bin/bash
    secret="blah"
    radiusip='YOURRADIUSiphere'
    
    echo "$secret $radiusip" >> testFile
    

    definitely works.

  • @black said:

    Be aware that in markdown syntax the back tick will be displayed as pre tag.

    ipaddr=`curl getipaddr.net -s | head -n 1`

    displays as

    ipaddr=curl getipaddr.net -s | head -n 1

    And to be honest I couldn't find any problem in the given script.

Sign In or Register to comment.