Not able read data with cat command


 
Thread Tools Search this Thread
Operating Systems Solaris Not able read data with cat command
# 1  
Old 02-21-2016
Not able read data with cat command

I am trying to read some data form .key file with cat command..but its not displaying data correctly..tried with other commands also still no use.i tried with CAT with SED combination but no use..

Please help me with the command or script.
# 2  
Old 02-21-2016
There is a cat command and there is a sed command. UNIX, Linux, and similar systems have utility names that are case sensitive. The cat utility cannot be invoked using the name CAT and the sed utility cannot be invoked using the name SED.

Making us guess at what you might have typed and now showing us the exact error message produced by your shell when you tried to get a command to work makes it impossible for us to give you any reasonable advice.

Tell us what operating system you're using.

Tell us what shell you're using.

Show us the exact name of your .key file and show us its contents.

Show us the exact command you tried to use to read data from that file.

Tell us what you expected to happen when you issued that command and show us the exact output that was produced when you issued that command.

Without all of the above requested basic information, we have little chance of making suggestions that will really help you do whatever it is that you are trying to do. Please help us help you.
This User Gave Thanks to Don Cragun For This Post:
# 3  
Old 02-21-2016
Thanks for the reply..

I can read other files data that is not a problem.but i have only problem with this .key file..
its deplaning as below.only little data where i supposed to get more data..
Code:
6.30.000.001|???????

it is Solaris and i am running command threw web shell.here i can not run VI or other editing tools..i have to get the data in file with cat command or any other.

below is the command
Code:
cat /data/security/get.key

and output as below..

Code:
6.30.000.001|???????

i supposed to get the key values,which i am not getting

Last edited by Don Cragun; 02-21-2016 at 02:55 PM.. Reason: Add CODE and ICODE tags.
# 4  
Old 02-21-2016
Please use code tags as required by forum rules!

It would be helpful if we knew WHAT you're after. Obviously it's not 6.30.000.001|???????. If the file has more than one line, do you want all of them, or are there any rules to select certain lines.
# 5  
Old 02-21-2016
i want to read all data in file.which i am not getting with this command..i tried lot of options but i still have issue..
# 6  
Old 02-21-2016
WHAT is "all data"? cat WILL yield the entire file!
# 7  
Old 02-21-2016
if i cat to folder name it will get download..
if i ct to file it will display data in browser..but .key data i am not able to get..

is there any other command to get the file downloaded in the browser..

see the below

command is executed from browser as below:
Code:
;EXECUTE_CMD;CMDLINE=cat /data/security/get.key


Last edited by vbe; 02-21-2016 at 07:45 AM.. Reason: code tags please
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

In PErl script: need to read the data one file and generate multiple files based on the data

We have the data looks like below in a log file. I want to generat files based on the string between two hash(#) symbol like below Source: #ext1#test1.tale2 drop #ext1#test11.tale21 drop #ext1#test123.tale21 drop #ext2#test1.tale21 drop #ext2#test12.tale21 drop #ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies

2. Shell Programming and Scripting

How can I read variable text files through cat command?

Hi. I'm just wondering how can I read variable text files through cat command. I made a shell script to count frequency of words and array them with variable conditions. It's only working for one file that I wrote in script now. But I want to make it working for every text file when I execute... (2 Replies)
Discussion started by: rlaxodus
2 Replies

3. Shell Programming and Scripting

Read files, lines into array, cat vs open

Hi Everyone, I have a file: a.txt a,b,c,d,6,6,6 1,2,3,d,6,6,6 4,5,6,6,6,6,6 #!/usr/bin/perl use warnings; use strict; my @array = (); ### Load file into array for my $i (split '\n', `cat /tmp/a.txt`) { push @array, ; } It works. But my a.txt have 1million lines, and... (2 Replies)
Discussion started by: jimmy_y
2 Replies

4. Homework & Coursework Questions

Need some help on using cat command

I have a file "sample.txt" with the content as below: Hi This is a Sample Text. I need a single command using cat which serve the following purpose. 1.display the contents of sample.txt 2.append some text to it 3. and then exit But, all should be served by a sinle... (1 Reply)
Discussion started by: ashok.g
1 Replies

5. Shell Programming and Scripting

help using read in menu script to cat out lines in logs

What is wrong with my menu script? Do I need to continue with the read statements? All I want to do with option 4 is to cat some /var/log/files and awk out a few lines? How do I do that please? $ cat menu.sh ... (11 Replies)
Discussion started by: taekwondo
11 Replies

6. Shell Programming and Scripting

cat in the command line doesn't match cat in the script

Hello, So I sorted my file as I was supposed to: sort -n -r -k 2 -k 1 file1 | uniq > file2 and when I wrote > cat file2 in the command line, I got what I was expecting, but in the script itself ... sort -n -r -k 2 -k 1 averages | uniq > temp cat file2 It wrote a whole... (21 Replies)
Discussion started by: shira
21 Replies

7. UNIX for Dummies Questions & Answers

Difference between cat , cat > , cat >> and touch !!!

Hi Can anybody tell the difference between Difference between cat , cat > , cat >> and touch command in UNIX? Thanks (6 Replies)
Discussion started by: skyineyes
6 Replies

8. UNIX for Advanced & Expert Users

how to read the data from an excel sheet and use those data as variable in the unix c

I have 3 columns in an excel sheet. c1 c2 c3 EIP_ACCOUNT SMALL_TS_01 select A.* from acc; All the above 3 col shoud be passed a variable in the unix code. 1.How to read an excel file 2.How to pass these data as variable to the unic script (1 Reply)
Discussion started by: Anne Grace
1 Replies

9. UNIX for Dummies Questions & Answers

using 'cat' to in 'while read line'

Hi, I'm having some trouble reading a file that was 'cat' through a while loop. Can anyone suggest alternatives? what i do is cat filename|grep *.stuff while read line do echo $line ... and other commands done The cat,grep line seems to work correctly, but the script hangs when i add in... (3 Replies)
Discussion started by: chugger06
3 Replies

10. Shell Programming and Scripting

Cat and read command

Here's what the shell (korn) script is doing: 1. Prompt for input 2. Read a file using the cat and the while read command. 3. Get a field on the record and hold that value in a variable. 4. Within the process, I then need to prompt the user again to ask them if they are sure they want to make... (3 Replies)
Discussion started by: mango
3 Replies
Login or Register to Ask a Question