Visit Our UNIX and Linux User Community


cat and wc options


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cat and wc options
# 1  
Old 09-08-2002
Question cat and wc options

Hi there

Can anyone tell me how to concatenate everything except the first line from one file to another.

right now I'm just doing
cat file1 >> file2, but I don't want the first line copied.

Also, does anyone know how to get a word count on every file with no file extension and execute permissions for others.
I've done this for all c files by the command
find . -name "*.c" -print | wc -l

but when I ealier found the files with no file extension and execute permission for others I used:

find "$argv[1] " -name "*" " grep -v "\."
foreach file (file2)
if (! -d $file && -x $file) then
.....

and I don't know how to incorporate this definition into a word count.

Thank for any help
Laura
# 2  
Old 09-09-2002
Lightbulb try this ...

try this ...

tail -n +2 file1 >> file2

then

ls | tr '.' '+' | grep -v "+" > output

for x in `cut -f1 -d" " output`
do
wc -l $x
done

Smilie
inquirer

Previous Thread | Next Thread
Test Your Knowledge in Computers #212
Difficulty: Medium
According to OSPF, an autonomous system boundary router is a router that is connected by using more than one routing protocol and that exchanges routing information with routers autonomous systems.
True or False?

7 More Discussions You Might Find Interesting

1. Ubuntu

Kernel boot options removed by fault, no boot options

Hello Everyone, First of all, I highly appreciate all Linux forum members and whole Linux community. http://forums.linuxmint.com/images/smilies/icon_wink.gif. I wish you the best for all of you ! I will try to be short and concise: I am using Linux Mint 10 for 2 months on 2 ws, and all went... (3 Replies)
Discussion started by: cdt
3 Replies

2. 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

3. Shell Programming and Scripting

for i in `cat myname.txt` && for y in `cat yourname.txt`

cat myname.txt John Doe I John Doe II John Doe III ----------------------------------------------------------------------- for i in `cat myname.txt` do echo This is my name: $i >> thi.is.my.name.txt done ----------------------------------------------------------------------- cat... (1 Reply)
Discussion started by: danimad
1 Replies

4. 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

5. AIX

no options

Hi All, I have a situation here that's very fun... I have a system with AIX and iPlanet (sunOne) installed, when occurs an unknown event on the network the WebServer shows a thousand of CLOSE_WAIT connections and this number grows and grows until the webserver crashs. I read some documents... (2 Replies)
Discussion started by: nascimento.rp
2 Replies

6. UNIX for Dummies Questions & Answers

options

I am just beginning to learn unix and I was wondering if there was a list of all the options somewhere on the net or hidden in the man pages? Also do options always have - and then a letter, or can it be - and a number as well? Thanks! (1 Reply)
Discussion started by: terms5
1 Replies

7. UNIX for Dummies Questions & Answers

cp options

Hello again, Is there an option for the cp command to overwrite existing files in the destination directory? Cheers Rob (3 Replies)
Discussion started by: milage
3 Replies

Featured Tech Videos