Shell commands

  • Tchuki
  • Mastermind
  • Mastermind
  • Tchuki
  • Posts: 1774
  • Loc: Edinburgh

Post 3+ Months Ago

Hi

I have the following three BASH line commands


mkdir /home/**/**/$username
echo $username >>/home/**/**/$username/$username
echo $password >>/home/**/**/$username/$username


That creates a directory from the variable $username [ read in from user in code above ] and then prints the $username & $password variables into a file called $username.

The data in the file is formated like below:

$username
$password

How can I get it so that it is formated like the next example below:

Username = $username
Password = $password


Also i have the following code:

if $extra_info = NULL
then
.....
fi

But for some reason the "=" command is unknown, any ideas ?


Thanks for any help.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Tchuki
  • Mastermind
  • Mastermind
  • Tchuki
  • Posts: 1774
  • Loc: Edinburgh

Post 3+ Months Ago

Meh ... useless folk ! :wink:


Worked it out myself:

echo "Username: $username" >>/home/**/**/$username/$username
echo "Password: $password" >>/home/**/**/$username/$username


if [ -n "$extra_info" ]
then
.....
fi


^^ Just incase anyone else has a similar problem.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 131 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.