use dot file in linux


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting use dot file in linux
# 1  
Old 09-23-2009
use dot file in linux

Hi,
I am creating a phonebook to store the name:phone:address.The phonebook is used to store, edit,delete and list the data. Now i need to use text file(dot files) for configuration (saving and loading selections). I really don't know how to do that. Please help
thanks..

Last edited by Yogesh Sawant; 09-23-2009 at 09:32 AM..
# 2  
Old 09-23-2009

Use it the same way you would any other file.
# 3  
Old 09-23-2009
create dot file

Sorry I am new to Linux. I didn't get what you mean. Can you please let me know in detail how to start that. Thanks in advance
# 4  
Old 09-23-2009
1. If you use vim editor to create text files, it will be like.
Code:
vim myphone.txt

If you want to create the dot file ( hidden file in Linux ).
Code:
vim .myphone.txt

Note: Prepended . ( dot )

2. In cat the same way.

3. Also if you are doing inside your program, while opening the file prepend the name of the file with . ( dot ).

Thats all, Got it ?!
# 5  
Old 09-24-2009
Thanks!! Just a quick question. Is dot file like a database, where we saved the data of phonebook..
# 6  
Old 09-24-2009
dot in front makes the files hidden file. but you can see with ls -a (-a option).

What you are asking about phone book is a big project !! look around on web, you might find something similar or pay someone to do the project for you.

Incase you are intrested Look at following in any scripting language:

How to create arrays ?
How to open files in read/write and append mode ?
How to separate records from a line you have read ?
What are hashes and how do you do a hash lookup
How to do a array lookup ?
# 7  
Old 09-25-2009
Quote:
Originally Posted by coolgal
Thanks!! Just a quick question. Is dot file like a database, where we saved the data of phonebook..

A dot file is like any other file: it can contain anything you like.

The only difference between a dot file and any other file is that, by default, it is not listed with ls or included in shell wildcard expansion.

If you want to keep your database in a dot file, you can.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rename except dot file extension

After reading the manual of the command rename I would like to apply it to a folder with a couple of files containing old style dots before the file-type, e.g. up.to.the.roof.avi. So I'd like to rename them without the dots in between. Therefore I tried it the following way rename -f -n ... (4 Replies)
Discussion started by: 1in10
4 Replies

2. Red Hat

Dot matrix Printer configuring on Linux RHEL AS 5.1

Dear Experts, We have requirement to configure Dot matrix printer in linux, Also need to register in Oracle application R12.0.6 version where i need get the print in landscape format. Request you all kindly help on the same. Thank you, Alone. ---------- Post updated 02-18-14 at 01:02... (6 Replies)
Discussion started by: Alone
6 Replies

3. UNIX for Advanced & Expert Users

Dot sourcing differences in ksh, AIX vs Linux vs Solaris

Why does dot sourcing of ksh functions behave so differently between AIX, Solaris, and Linux? How can I make Linux behave the way I want in the test I show below? I have a library of interdependent functions I have developed and use in ksh in AIX. They also run in Solaris. Now I am migrating... (9 Replies)
Discussion started by: charles_n_may
9 Replies

4. Shell Programming and Scripting

How to remove. (dot) if found in the beginning of file name while doing wget (download)?

Dear All, How to remove. (dot) if found in the beginning of file name while doing wget (download)? I am facing problem while re-sizing the image by using ImageMagick. Two dots in the file name are causing problem. ImageMagick is skipping such image with a dot . in the beginning, like ... (1 Reply)
Discussion started by: Praveen Pandit
1 Replies

5. Shell Programming and Scripting

List the file with a dot

I am on hp-ux and not able to catch the file with dot using a wild card. $ touch .test $ ls -l .test -rw-r--r-- 1 oracle dba 0 Mar 21 05:20 .test $ ls -l *test *test not found $ ls -la *test *test not found Why i am not able to list the file startign with .... (7 Replies)
Discussion started by: bang_dba
7 Replies

6. Shell Programming and Scripting

grep'ing dot history file

Hi, I tried to grep ".sh_history" (DOTsh_history) file and did not return anything though I found the word in .sh _history file through vi editor in Linux. Then I tried to grep ".profile" to check if it is the prob with hidden files and I got results. Then I verified the same with my friend... (4 Replies)
Discussion started by: bobbygsk
4 Replies

7. Shell Programming and Scripting

How to Removing a dot from a file name?

I need a script that will allow me to rename all of my files in subdir /FilesIn as follows: From kumc_835_111200.RMT.dat to kumc_835_111200RMT.dat kumc_835_111200.KMR.dat to kumc_835_111200KMR.dat .................etc How do I do that whithout doing a sed ... (10 Replies)
Discussion started by: mrn6430
10 Replies

8. Programming

how to call dot c file using system command

Hi every one, i have to dot pc files. One have main function but one dont have.I have to call dot pc file using system () cmd.File is being call have main function.Please let me know how i can call .pc file with two arguments from other dot pc file.I want some thing like sprintf(buf, "ss_xxx.pc... (4 Replies)
Discussion started by: goraya430
4 Replies

9. Shell Programming and Scripting

how to call dot c file using system command

Hi every one, i have to dot pc files. One have main function but one dont have.I have to call dot pc file using system () cmd.File is being call have main function.Please let me know how i can call .pc file with two arguments from other dot pc file.I want some thing like sprintf(buf,... (1 Reply)
Discussion started by: goraya430
1 Replies

10. Shell Programming and Scripting

Replace path in a file with dot

Hi, I have a file with below values. /uvxapps/etl/Ascential/DataStage/DSEngine/dsenv.orig /uvxapps/etl/Ascential/DataStage/DSEngine/dsenv /uvxapps/etl/Ascential/DataStage/DSEngine/sample/.cshrc /uvxapps/etl/Ascential/DataStage/DSEngine/sample/.login... (3 Replies)
Discussion started by: njoshi
3 Replies
Login or Register to Ask a Question