how to open a file and read a file in UNIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to open a file and read a file in UNIX
# 1  
Old 07-26-2011
how to open a file and read a file in UNIX

HI can any one tell me how to open and read a file in UNIX

actually i have the following script can you please suggest me on this..

LOG,">$log" or NotifyAdmin "Failed to open file $log";... this is the perl statement.. which opens log file. i want to open same log file in unix

Thanks
sravan
# 2  
Old 07-26-2011
Code:
open LOG, ">", "$log" or die $!

# 3  
Old 07-26-2011
how to open a file and read a file contents in turboC shell ?? please respond asap
# 4  
Old 07-26-2011
???
Code:
cat FILENAME

# 5  
Old 07-26-2011
what is turboC shell
# 6  
Old 07-26-2011
Are you currently participating a test? For urgent and "asap"-threads, there is an extra sub forum and classroom/homework stuff has also an extra sub forum. Best you read the The UNIX and Linux Forums - Forum Rules first and obeye them.

-closed-
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies

2. Shell Programming and Scripting

Not able to read .csv file until open in vi editor

Hi, I am facing a problem regarding .csv file, my script does not read .csv file and if i open this file in vi editor and perform :wq option then only my script reads the .csv file. Thanks (5 Replies)
Discussion started by: ranabhavish
5 Replies

3. Shell Programming and Scripting

Open a file in UNIX mode

hi, The function open(OUTPUT, ">$output_filename"); #opens the file in (DOS) windows mode. how to open the output file in unix mode. please suggest. thanks. (10 Replies)
Discussion started by: Rashid Khan
10 Replies

4. Solaris

Before I delete any file in Unix, How can I check no open file handle is pointing to that file?

I know how to check if any file has a unix process using a file by looking at 'lsof <fullpath/filename>' command. I think using lsof is very expensive. Also to make it accurate we need to inlcude fullpath of the file. Is there another command that can tell if a file has a truely active... (12 Replies)
Discussion started by: kchinnam
12 Replies

5. UNIX for Dummies Questions & Answers

open windows's .url file in unix

In windows, I can create a shortcut for websites. It's a .url file. the content of the file is like: How can I open it, the .url file, in firefox or google chrome in Unix(or just ubuntu)? (2 Replies)
Discussion started by: hz_i3
2 Replies

6. Solaris

file open/read/write/close/access by process

Hi want to know what file (descriptor+filename+socket) is being accessed by particular process on solaris. Purpose : while running perf. test, needs to find where is the bottleneck. We are providing concurrnet load for around 1 hr and needs to capture data related to file usage pattern... (1 Reply)
Discussion started by: raxitsheth
1 Replies

7. UNIX for Advanced & Expert Users

How can i read a non text file in unix - ELF-64 executable object file - IA64

The binary file is ELF-64 executable object file - IA64. How i know that the source is Is there any comamnd in unix i can read these kind of files or use a thirty party software? Thanks for your help (8 Replies)
Discussion started by: alexcol
8 Replies

8. Shell Programming and Scripting

Win32::OLE open excel file as read only

I am using Win32::OLE to write a perl script which opens an excel file. That excel file is password protected and everytime i run that script dialog box pops up and I have to click on Read-Only then my script executes. Is there any way I can specify the readonly attribute in my code so i dont have... (0 Replies)
Discussion started by: dguy
0 Replies

9. Shell Programming and Scripting

open unix file in windows

Hi, I have a text file in unix. i am trying to give a link in Internet explorer to that file. If i click on the link in Internet Explorer page then it should display the text from file in unix. is that anyway possible.... i am trying it for past 2 days....if i find a way out i will... (3 Replies)
Discussion started by: ganesh
3 Replies

10. UNIX for Dummies Questions & Answers

How do u open a read only file in Unix?

How do u open a read only file in Unix? (1 Reply)
Discussion started by: JosephGerard
1 Replies
Login or Register to Ask a Question