Jump to content

Using a variable in a command


ukscotth

Recommended Posts

#!/bin/bash
clear
echo "Enter username :"
read username
cd /
cd /home/$username/

Hi,

 

I'm new to batch scripting and i'm trying to insert a variable into a command but cant get it working, can someone please tell me how I do the following properly :

 

Thanks in advance.

 

 

Link to comment
https://forums.phpfreaks.com/topic/286583-using-a-variable-in-a-command/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.