Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Removing a specific word from a created list Post 302140551 by erest8 on Sunday 14th of October 2007 05:11:36 AM
Old 10-14-2007
Cali, I tried your script...

Cali,
I appreciate your help. I tried running this script you sent me, but when I run it I get a syntax error at line 12...regarding the fi. Could you please help me a little more and please let me know what exactly the fi means/does? Also, will this script eliminate the blank entry at the top of my .dat files?
Thank you very much.


Quote:
Originally Posted by cali
You can use:
variable=" "
echo $variable > name.dat
while [ "$variable" != "finished" ]
do
echo "Please enter your name (type finished when done)"

read variable
if [ $variable != "finished" ] then
echo $variable >> name.dat
sort < name.dat > sorted_name.dat
fi
echo $variable
done

Good luck.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List files created between specific date and time

Hi I need to write a script to list files in a directory created within specific date and time for eg list files created between Apr 25 2007 11:00 to Apr 26 2007 18:00. and then i have to count them Any suggestions pls ? (3 Replies)
Discussion started by: jazjit
3 Replies

2. Filesystems, Disks and Memory

How to list files with specific created date

Hi, Would like to ask, which command is used to list all the files for specific date (says 1st May) and its size, for all files (including its subdirectory), in a mounted NFS disk to HP-UX. I would like to check for the total files came into my disk on 1st May. Very much appreciating your... (2 Replies)
Discussion started by: Draculla
2 Replies

3. Shell Programming and Scripting

How to replace a specific word in specific column?

Hi My orginal file is like (100s of lines) id host ip location remarks 1 host1 ip1 - xxx 2 host2 ip2 - xxx 3 host3 ip3 - xxx -- -- 9 host9 ip9 - xxx I have a ref file like host1 location1 host2 location2 host3 location3 -- --... (6 Replies)
Discussion started by: ./hari.sh
6 Replies

4. UNIX for Dummies Questions & Answers

How to print line starts with specific word and contains specific word using sed?

Hi, I have gone through may posts and dint find exact solution for my requirement. I have file which consists below data and same file have lot of other data. <MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'> <MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies

5. Shell Programming and Scripting

bash script removing files except last one created

Hello there, can anyone please help to write a bash script that can achieve the following: 1) list files that contain a certain string in order of their creation date. Ideally the script should ask me to type in the string by hand. 2) use that list and remove all except the last one created... (2 Replies)
Discussion started by: kjartan
2 Replies

6. Shell Programming and Scripting

Fetch entries in front of specific word till next word

Hi all I have following file which I have to edit for research purpose file:///tmp/moz-screenshot.png body, div, table, thead, tbody, tfoot, tr, th, td, p { font-family: &quot;Liberation Sans&quot;; font-size: x-small; } Drug: KRP-104 QD Drug: Placebo Drug: Metformin|Drug:... (15 Replies)
Discussion started by: Priyanka Chopra
15 Replies

7. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

8. Shell Programming and Scripting

How to print multiple specific column after a specific word?

Hello.... Pls help me (and sorry my english) :) So I have a file (test.txt) with 1 long line.... for example: isgc jsfh udgf osff 8462 error iwzr 653 idchisfb isfbisfb sihfjfeb isfhsi gcz eifh How to print after the "error" word the 2nd 4th 5th and 7th word?? output well be: 653 isfbisfb... (2 Replies)
Discussion started by: marvinandco
2 Replies

9. Shell Programming and Scripting

Search for a specific word and print only the word from the input file

Hi, I have a sample file as shown below, I am looking for sed or any command which prints the complete word only from the input file. Ex: $ cat "sample.log" I am searching for a word which is present in this file We can do a pattern search using grep but I need to cut only the word which... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies

10. Shell Programming and Scripting

Files created on specific time

Hello Gurus, I am facing one issue to get a file for a specific time. There are about 300 files created between 6.30 pm to 7.15 pm everyday. Now I wanted only the file which is created on 6.45pm. No other files required. I have used "find" command to get the files, but not getting the expected... (3 Replies)
Discussion started by: pokhraj_d
3 Replies
ARP2ETHERS(8)						      System Manager's Manual						     ARP2ETHERS(8)

NAME
arp2ethers - convert arpwatch address database to ethers file format SYNOPSIS
arp2ethers DESCRIPTION
arp2ethers converts file arp.dat in the current directory into ethers(5) format on stdout. Usually arp.dat is an ethernet/ip database file generated by arpwatch(8). The arpwatch daemon in Debian will create different arp.dat depending on its configuration. All of them will be available at /var/lib/arpwatch/. FILES
/var/lib/arpwatch - default directory for arp.dat arp.dat - ethernet/ip address database SEE ALSO
arpwatch(8), ethers(5), rarp(8), arp(8), BUGS
Please send bug reports to arpwatch@ee.lbl.gov. AUTHORS
Original version by Craig Leres of the Lawrence Berkeley National Laboratory Network Research Group, University of California, Berkeley, CA. Modified for the Debian Project by Peter Kelemen, with additions from Erik Warmelink. The current version is available via anonymous ftp: ftp://ftp.ee.lbl.gov/arpwatch.tar.gz This manual page was contributed by Hugo Graumann. ARP2ETHERS(8)
All times are GMT -4. The time now is 01:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy