10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a shell script, which reads a *.txt file - line by line. In this text file, I have some lines beginning with "#" that I want to ignore :
MY_FILE
#blah blah blah 1
blah blah blah 2
blah blah blah 3
#blah blah blah 4
I want my script to read only the following lines... (3 Replies)
Discussion started by: ad23
3 Replies
2. Shell Programming and Scripting
Hi,
i am having one text file it contains some blank lines and i want to ignore that blank lines .
#! /bin/bash
clear
rdCount=0;
while read myline
do
echo $myline
let rdCount=$rdCount+1
done < ps.txt
echo "Total line=$rdCount"
and ps .txt contains the data- (17 Replies)
Discussion started by: aish11
17 Replies
3. UNIX for Dummies Questions & Answers
:confused:Hi,
I'm relativley new at unix so am having difficulties at the most basic of areas. I am trying using sed to make multiple lines into one line.
For example, i would like:
Mary
had
a
little
lamb
to look like this
Maryhadalittlelamb
so far i have tried
sed... (1 Reply)
Discussion started by: cavanac2
1 Replies
4. Shell Programming and Scripting
Hi all,
I'm looking for a way to generate an error when a command does not print an expected message. For example :
test.sh :
echo hi!test.exp :
exp_internal 1
spawn ./test.sh
expect {
"hi!" {puts "bingo!"}
"*" {puts "error!" ; exit 1}
}
I expected test.exp to match the string... (2 Replies)
Discussion started by: whbos
2 Replies
5. Shell Programming and Scripting
I just wrote a tiny script with the help of ghostdog74 to search all my files for special content phrases.
After a few modifications I now made it work, but one problem is left. The files are located in public_html folder, so there might also be .htaccess files.
So I ignored scanning of that... (4 Replies)
Discussion started by: medic
4 Replies
6. Shell Programming and Scripting
Hello Experts,
I have two files called "old" and "new". My old file contains 10 lines and my new file contains 10 + "n" lines.
The first field in both these files contain ID. I sort these two files on ID. I am interested in only the lines that are in the new file and not in old.
I tried... (4 Replies)
Discussion started by: forumthreads
4 Replies
7. Shell Programming and Scripting
Is there a way to tell awk to ignore the first 11 lines of a file?? example, I have a csv file with all the heading information in the first lines. I want to split the file into 5-6 different files but I want to retain the the first 11 lines of the file.
As it is now I run this command:
... (8 Replies)
Discussion started by: trey85stang
8 Replies
8. Shell Programming and Scripting
From the below file I want to grep only the lines except the comment sections. But grep -v "#" is eliminating the last line because it has one # in between.
Any idea how can I ignore only the lines which have # at the begining (I mean comment lines) ?
Thanks a lot to all in advance
C Saha (1 Reply)
Discussion started by: csaha
1 Replies
9. Shell Programming and Scripting
Is there a standard way to make a shell script read a file, or list, and skip each line that contains # at the begining, or ignores the content starting after a # in line?
I'm looking to mimic the way commenting in a shell script normally works. This way I can comment my text files and lists my... (4 Replies)
Discussion started by: sysera
4 Replies
10. UNIX for Advanced & Expert Users
I ask this question since sometimes i run a time-consuming ftp in foreground and forget to use nohup ftp.sh & to put this work background and can still running after i log off.
Assume this ftp task have run 1 hour, and still 1 hour time to end,
i don't want to abort the ftp, first, i use ctrl+Z... (3 Replies)
Discussion started by: stevensxiao
3 Replies