10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I pass a number to my script. Passing "1" below.
./getfile.sh 1
echo "User entered: $1"
ls -ltr *.conf | sed -n '$p'
I wish to use ls -ltr i.e list files in ascending order of time the latest showing at the bottom of the output.
Number 1 should get me the last row of ls -ltr output i.e... (9 Replies)
Discussion started by: mohtashims
9 Replies
2. Homework & Coursework Questions
First month learning about the Linux terminal and it has been a challenge yet fun so far. We're learning by using a gameshell. I'm trying to display a certain line ( only allowed 1 command ) from a file only using the head or tail. I'm pretty about this answer:
head -23 history.txt | tail -1... (1 Reply)
Discussion started by: forzatekk
1 Replies
3. Shell Programming and Scripting
awk 'BEGIN{IGNORECASE=1} /error|warning|exception/ { ++x } END { print x }' filename
The above command returning the number of times the pattern present in the file. But I want the the line number as well. please help me out (6 Replies)
Discussion started by: arukuku
6 Replies
4. Shell Programming and Scripting
Hello Guys,
I have created function which is as follow:
tail -f filename |grep "Key word"
output from this command
19-11-2011 21:09:15,234 - INFO Numbement - error number:result = :11
19-11-2011 21:09:15,286 - INFO Numbement - error number:result = :11
19-11-2011 21:09:15,523 - INFO... (5 Replies)
Discussion started by: ooilinlove
5 Replies
5. Shell Programming and Scripting
Hi ,
1)i want to display specific line number using tail command.
e.g. display 10 line from end.
Please help...
2)Want to display line 10 to 15 (from end)using tail command) (2 Replies)
Discussion started by: vivek1489
2 Replies
6. Shell Programming and Scripting
Hi everyone, I'm trying to write a script to format a file using unix2dos. I want to output all but the first 14 lines in a file. Then I want to pipe this to unix2dos to convert the output to a file that's easily readable on windows. Here's what I have:
export Lines=`wc -l < $1`
export... (11 Replies)
Discussion started by: LuminalZero
11 Replies
7. Shell Programming and Scripting
I have a code here , which should display lines 6,10,14,18,35 of a text file
#!/bin/ksh
line=6
line=10
line=14
line=18
line=35
for i in 1 2 3 4 5
do
val=`echo ${line}`
act=`awk 'NR~/^($val)$/' db_CHECKOUT.txt`
done;
This code is not working. The purpose of the line below is... (3 Replies)
Discussion started by: njafri
3 Replies
8. UNIX for Dummies Questions & Answers
Hi. Is there a way in awk to show all lines between a line number and the next line containing a particular regex? We can do these, of course:
awk '/regex1/,/regex2/' filename
awk 'FNR > X && FNR < Y' filename
But can they be combined? Thanks. (3 Replies)
Discussion started by: treesloth
3 Replies
9. Shell Programming and Scripting
hi
we have 3 servers and we have a script to monitor cpu usage of all 3 servers and writes into one file on one of the server where we monitor all those servers ( by doing tail -f filename ) so we decided to create script ( perl ) that will read values from this file and display it should be like... (2 Replies)
Discussion started by: zedex
2 Replies
10. UNIX for Dummies Questions & Answers
I have a file that has 1k lines and i want to print all the lines after 900th line.
an 2)I want to move files f1 ,f2,f3,f4 to p1,p2,p3,p4
Please give me the commands.
Thanx in adv. (6 Replies)
Discussion started by: rajashekar.y
6 Replies