cat a file starting with ~|


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cat a file starting with ~|
# 1  
Old 07-15-2008
cat a file starting with ~|

helo all

I have a file where lines start with ~|.
Given a sample line-> ~|21|123|1232|ABC|2135....
So when i use the command

-----cat $file | mailx -s "Rejects : $envid" $recip.dat------

When unix cats the file which holds lines starting with ~| it seems to be it takes those lines as commands and starts putting them on screen.This is upto my Assumption.But donno what happens exactly

So when the command is executed
I get the following warning messages on the screen...

/usr/bin/ksh: 21: not found.
/usr/bin/ksh: 123: not found.
/usr/bin/ksh: 1232: not found.
/usr/bin/ksh: ABC: not found.
/usr/bin/ksh: 2135: not found.


If anyone can help me out in getting these warnings move out, that would be great...Smilie

Thanks
KenJo
# 2  
Old 07-16-2008
Unfortunately ~ is a prefix for some commands used in mail while entering a message. Type mail someone and then ~? to see the list of commands.

You might have to attach the output to the message using uuencode instead, or else you could prefix each line with a space or something if it only needs to be readable by humans.
# 3  
Old 07-16-2008
That was of Great help and it worked out...Thanks a lot....
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep a log file starting from a specific time to the end of file

I have a log file which have a date and time at the start of every line. I need to search the log file starting from a specific time to the end of file. For example: Starting point: July 29 2018 21:00:00 End point : end of file My concern is what if the pattern of `July 29 2018 21:00:00`... (3 Replies)
Discussion started by: erin00
3 Replies

2. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

3. Shell Programming and Scripting

Ssh cat file output into a file on local computer

Hello, I'm on a remote computer by SSH. How can I get the output of "cat file" into a file on the local computer? I cannot use scp, because it's blocked. something like: ssh root@remote_maschine "cat /file" > /locale_machine/file :rolleyes: (2 Replies)
Discussion started by: borsti007
2 Replies

4. UNIX for Advanced & Expert Users

for i in `cat file` do

in bash: for i in `cat file` ; do echo $i done; how will i do this in perl ? (10 Replies)
Discussion started by: linuxgeek
10 Replies

5. Shell Programming and Scripting

Cat file

how to cat a file by ignoring first line and last line (1 Reply)
Discussion started by: thelakbe
1 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 Dummies Questions & Answers

How to cat file

I want to cat a file with only show the line contain '/bin/bash' but don't show the line contain 'load' (don't show if the line contain 'load' and '/bin/bash' together), how to type in the command? thk a lot! (2 Replies)
Discussion started by: zp523444
2 Replies

9. UNIX for Dummies Questions & Answers

Easiest way to cat out first 100 lines of a file into a different file?

Not sure how to do this exactly.. just want to take the first 100 lines of a file and cat it out into a second file. I know I can do a more on a file and > it into a different file, but how can I make it so only the first 100 lines get moved over? (1 Reply)
Discussion started by: LordJezo
1 Replies
Login or Register to Ask a Question