Solved

bash line file output

Posted on 2006-06-09
2
213 Views
Last Modified: 2010-04-22
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


Thanks for any help.
0
Comment
Question by:3nigmatic
2 Comments
 
LVL 2

Author Comment

by:3nigmatic
ID: 16872264
Never mind, answered my own question:

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

Silly schoolboy error.
0
 

Accepted Solution

by:
EE_AutoDeleter earned 0 total points
ID: 17026692
3nigmatic,
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now