Fuzzybear
Fuzzybear

Reputation: 1418

bash command to create custom named file

Simple task probably buy I can not seem to find the command on http://faculty.plattsburgh.edu/jan.plaza/computing/help/commands.html

Basically I have a string of text that I know and have set in a variable on my bash file.

I then need to save this text as a file called Foo.conf in desired directory.

Here is what I have so far:

#!/bin/bash
stringForFile='port=6000 Username=USER Password=PASSWORD'
mkdir '~/.Foo'
# need to save file as Foo.conf to .Foo directory 

many thanks in advance

Upvotes: 0

Views: 97

Answers (1)

SSaikia_JtheRocker
SSaikia_JtheRocker

Reputation: 5063

Why not use echo $stringForFile > ~/.Foo/Foo.conf after mkdir command?

Upvotes: 1

Related Questions