Solved

bash line file output

Posted on 2006-06-09
2
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 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