' for reading (No such file or directory) `Solaris_websummary.txt


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ' for reading (No such file or directory) `Solaris_websummary.txt
# 1  
Old 06-23-2015
' for reading (No such file or directory) `Solaris_websummary.txt

Code:
echo  "1.1    Apply latest OS patches;"  
awk '/1.2 Install/ {P=0} P {print $0} FNR==1{printf("From file %s:\n", FILENAME)} /1.1 Apply/ {P=1}' solarisappsummary.txt solarisdbsummary.txt solaris_websummary.txt 
echo "1.2    Install TCP Wrappers;"    
awk '/1.3 Install/ {P=0} P {print $0} FNR==1{printf("From file %s:\n", FILENAME)} /1.2 Install/ {P=1}' solarisappsummary.txt solarisdbsummary.txt solaris_websummary.txt

Why is the error on the title showing up?
# 2  
Old 06-23-2015
As has been suggested in some of your threads before, UNIX utilities expect lines to be terminated by a <newline> character; not a <carriage-return><newline> character pair! Get rid of the <carriage-return> characters at the ends of the lines in your shell script and your script will stand a chance of being able to process files named solaris_websummary.txt instead of failing when it tries to find a file named solaris_websummary.txt<carriage-return>.

AND PLEASE, be careful when showing us diagnostic messages produced by your code. You should never see a message about a filename starting with a capital letter when the filenames in your script do not contain any capital letters. Although diagnostic message output can vary from system to system, with the code you showed us, we would expect diagnostics more like:
Code:
'wk: can't open file 'solaris_websummary.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How can i add each line from a txt file to different files in the same directory?

Hello, this is my first thread here :) So i have a text file that contains words in each line like abcd efgh ijkl mnop and i have 4 txt files, i want to add each line to each file, like file 1 gets abcd at the end; file 2 gets efgh at the end .... I tried with: cat test | while read -r... (6 Replies)
Discussion started by: azaiiez
6 Replies

2. UNIX for Dummies Questions & Answers

' for reading (No such file or directory)

1.1 Solaris 10 8/07 s10s_u4wos_12b SPARC 1.2 Patch: 127714-03 Obsoletes: Requires: 120011-14 Incompatibles: Packages: SUNWsshcu, SUNWsshdu, SUNWsshu Patch: 128253-01 Obsoletes: Requires: Incompatibles: Packages: SUNWsshcu Patch: 126630-01 Obsoletes: Requires: Incompatibles: Packages: SUNWtcsh 1.3... (3 Replies)
Discussion started by: alvinoo
3 Replies

3. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies

4. UNIX for Dummies Questions & Answers

Delete .txt file from current directory

I have created few text file during run time by redirecting the txt file echo USER_LIST_"$(date '+%d%h%Y')".csv > report_location.txt report_location.txt is creating in the same location where I run script home/script When I try to remove the txt file at the end of the... (3 Replies)
Discussion started by: stew
3 Replies

5. UNIX for Dummies Questions & Answers

C-Shell script help reading from txt file

I need to write a C-Shell script with these properties: It should accept two arguments on the command line. The first argument is the name of a file which contains a list of names, and the second argument is the name of a directory. For each file in the directory, the script should print the... (1 Reply)
Discussion started by: cerce
1 Replies

6. Shell Programming and Scripting

Script to delete all something.txt~ file from a directory

There are some files in a directory like a.tx~ , b.txt~,c.txt~. I want to delete all these files inside that directory and sub directory. How can i do this? #!/bin/bash cd thatdirectory ...... rm -rf *~ ...... (7 Replies)
Discussion started by: cola
7 Replies

7. Red Hat

How to get the name of the first *.txt file in a directory?

Please tell me the command to get the name of the first txt file found in a directory in a variable? I need to use it in a shell script. (3 Replies)
Discussion started by: omariqbalnaru
3 Replies

8. Programming

Reading a particular line from a .txt file

Hi, I have a .txt file which contains the x, y and z co-ordinates of particles which I am trying to cast for a particular compound. The no. of particles present is of the order of 2 billion and hence the size of the text file is of the order of a few Gigabytes. The particles have been casted layer... (5 Replies)
Discussion started by: mugga
5 Replies

9. Shell Programming and Scripting

reading the txt file

hi to all im having some 20,000 files in that im having some contents say the tabulation of biophysics lab readings ... and i want read tat file and look into tat wether a number say -18.90 is there r not .. and if there print tat no wit file name beside thank you:D (1 Reply)
Discussion started by: maximas
1 Replies

10. Shell Programming and Scripting

Reading Characters from txt file

Hello, I am new to shell scripting, and I am trying to create a script that reads an input like the following firstname:lastname:age firstname:lastname:age firstname:lastname:age in a text file. I have a 2 part question. First how do I open the file in a shell script. And then how can... (7 Replies)
Discussion started by: TexasGuy
7 Replies
Login or Register to Ask a Question