opening a file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers opening a file
# 1  
Old 03-30-2004
opening a file

im trying to open a file in my bin directory and the farthest i can get is into the folder but not the actual file itself i use text edit as the editor. when i try to open the file it says it doesn't exist here is what i type



cd bin
open cmnds (dir. which it is under)
open test
no such file


am i missing something or is that the farthest i can go to opening a file
# 2  
Old 03-30-2004
"test" is the name of a Unix command, so it could be causing conflict.

Rename the file to something other than "test" and see if that helps.
# 3  
Old 03-30-2004
it still won't open it i changed it to a bunch of different names i tried

open -adg
open -a adg


(btw adg is the new name)

i don't understand, perhaps adg is a command to?
# 4  
Old 03-31-2004
I've never used "Text Edit", but you could try opening the file in a standard editor like "vi". Open a shell, and type

Code:
vi /path/to/file/file_name

Once vi launches, press ESC, then type
Code:
:q

to exit straight away. That should at least prove if the file is "openable".

Also, check your permissions on the file,
Code:
ls -l /path/to/file/file_name

The permissions should at least be something like -rw-r--r-- or whatever, depending on your umask.

Cheers
ZB
http://www.zazzybob.com
# 5  
Old 04-01-2004
I am not so sure when you said "open" it. Doesn't the command "open" mean to start a program on a new terminal? Are you sure the file is there? If you want to run it, why just try "./file"? Or if you want to read the file content, use cat, more, or some editor such as vi/vim, emacs.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to read a file without opening the file and delete last line?

I have file called "text". The contents are as below : aaa bbb ccc ddd eee ffff ddd hhhh iiii I want to read this file without opening and and delete the last line. How can it be done? (4 Replies)
Discussion started by: the_hunter
4 Replies

2. Shell Programming and Scripting

Opening a file in vi and automatically save and quit this file using shell script

Hi friends, In my shell script, I want to open a file using vi editor. After opening the file in vi, I want to save and quit this file automatically.... all through shell script. the code segment is: ------------------------------------------------------------ cd ~/netfpga/projects/scone/sw/... (2 Replies)
Discussion started by: sachinteotia
2 Replies

3. Shell Programming and Scripting

GZ file not opening in windows

I am zipping a file in unix and then sending it to windows. buyt when i try to open it with 7zip software. it throws an error FILE IS BROKEN (3 Replies)
Discussion started by: rafa_fed2
3 Replies

4. Shell Programming and Scripting

Xmllint - Xml-file problem --ods file not opening

Dear All, this is my first post on this Forum, glad to be here. I'm trying to fix an .ods file. Yes, I had a backup, but it's also corrupted. When opening the document I get this EM: read error format error discovered in the file in sub-document content.xml at 2,337040(row,col). So I... (3 Replies)
Discussion started by: jameslast
3 Replies

5. Programming

Problem in opening a file!

Hello All, I am new to programming in unix. I am trying to create a file by using open command. The entire file is : #include<fcntl.h> main(void){ int fd; fd = open("File1", O_CREAT|O_WRONLY, S_IRUSR|S_IWUSR|S_IRWXO); printf("%d ", fd); } The problem I am facing a strange problem.... (2 Replies)
Discussion started by: vkn_1985
2 Replies

6. Programming

Error in opening a file C++

Hi, I have written a function which will open the file with the input name provided.Input name is in string format so while opening I am converting it using c_str().detail code below Plz let me know what is the wrong in code. 1 #include<iostream> 2 #include<fstream> 3 ... (4 Replies)
Discussion started by: forstudy3
4 Replies

7. Shell Programming and Scripting

Deleting lines inside a file without opening the file

Hi, Just consider there are around 10 lines in a file. Now is it possible to delete the first 2 lines in the file without opening the file. No matter whatever the content of the file is, I just wanna delete the first 2 lines without opening the file. Is that possible? If so, please help me out.... (3 Replies)
Discussion started by: toms
3 Replies

8. UNIX for Dummies Questions & Answers

Opening a file from the terminal

Hi, this is such a simple question (I think), but I don't know the answer, obviously. If I'm using the terminal, and I'm remotely logged on to another computer, and I'm in my directory on that computer, what command would I use to...open a file? For example, a .exe file, or a .txt file...all I want... (6 Replies)
Discussion started by: Djaunl
6 Replies

9. Shell Programming and Scripting

how to know whether that file has eol or noeol before opening that file in VI editor

Hi, I want to check whether file has EOL or NOEOL before opening this file in VI editor. My file is very big its in terms of 15-20 MB. I am using ksh for this. When we opened the file in vi editor, normally at last line we are able to see whether this is eol or noeol file. But i does want... (1 Reply)
Discussion started by: HariRaju
1 Replies

10. Shell Programming and Scripting

Making Changes without opening file

Hello, I'm new to scripting, I have a file test.dat. I want to make changes to it with out openning it. Example: test.dat has rows, and I want to change value "LA" to "TX" without opening it or without writing it to another file. Is it possible? Thanks (9 Replies)
Discussion started by: irehman
9 Replies
Login or Register to Ask a Question