Sponsored Content
Full Discussion: Help!!!
Top Forums Shell Programming and Scripting Help!!! Post 302181946 by tmz on Friday 4th of April 2008 02:05:13 PM
Old 04-04-2008
Bug Help!!!

Hi ya

I need some help please I am trying to read an input file and look for occurrences of the current user who is executing the script. On finding an occurrence of the username take that line and append it to a file and display a line number and a bracket against the saved line.

so far i created a file xx
with env sent to it 5 times

then i created this script but I only manged to get 1) next to each line that greped from the xx file which contained env 5 times: -

echo "Enter the file name to search username: "
read fileName
egrep -w "PWD" $fileName | head -1 | nl -ba -w1 -s\) >> test
egrep -w "USER" $fileName | head -1 | nl -ba -w1 -s\) >> test
egrep -w "MAIL" $fileName | head -1 | nl -ba -w1 -s\) >> test
egrep -w "LOGNAME" $fileName | head -1 | nl -ba -w1 -s\) >> test
egrep -w "HOME" $fileName | head -1 | nl -ba -w1 -s\) >> test

thanks in advance I have been racking my brains please help!!!!!
 
INSTALLSIEVE(1) 					      General Commands Manual						   INSTALLSIEVE(1)

 *

NAME
installsieve - user utility for managing sieve scripts SYNOPSIS
installsieve DESCRIPTION
installsieve is a utility that allows users to manage their sieve scripts kept on the server. OPTIONS
-v <name> View script with the given name. The script if retrieved sucessfully is output to standard output. -l List all of the scripts currently on the server. If one of the scripts is active a arrow is printed indicating that it is the active script. -p <port> Port to connect to. If left off this defaults to "sieve" as defined in /etc/services. -i <file> Install a file onto the server. If a script with the same name already exists on the server it is overwritten. Upon sucessfully putting the script on the server the script is set active. If <file> has the extension .script it is chopped when put on the server since sieve names may not contain a '.'. -a <name> Set <name> as the active script. The list of available names can be obtained from the '-l' option.. -d <name> Delete the sieve script on the server with <name>. -m <mechanism> Force installsieve to use <mechanism> for authentication. If not specified the strongest authentication mechanism is chosen. -g <name> Get the sieve script with <name> and save it to disk with a ".script" extension. If a file with that name already exists it is overwritten. -u <user> Userid/Authname to use for authentication; by default, the current user. CMU
Project Cyrus INSTALLSIEVE(1)
All times are GMT -4. The time now is 12:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy