Search Results

Search: Posts Made By: magnia
1,594
Posted By magnia
got it to work, i catted $line then used pipe to...
got it to work, i catted $line then used pipe to do the cut and it worked fine
1,594
Posted By magnia
error while using cut
im reading in a file line by line and trying to cut part of it but it wont work and is giving me this error

ipaddress=`cut -d ' ' -f 2 $line`


im getting this error

work1: line 23: [: :...
2,798
Posted By magnia
comparing variables
im trying to compare ipaddresses. i loop through an array to see if the ip is already is in the array and if it is it should set a flag and then i wont add it to the array. but its just adding all...
1,270
Posted By magnia
try grep '/07/23/' > results.txt
try grep '/07/23/' > results.txt
2,369
Posted By magnia
outputting a text file in html
is there anyway i can paste/cat a text file into a html paragraph <p>
function html_header

{
cat <<END
<html>
<head><title>${1}</title></head>
<body>
<p>
${2}
</p>...
2,212
Posted By magnia
date command
Hi is it possible to give the date command like 24th July 2009

ive tried

DATE=`date "+%d%m%Y"
echo $DATE

that only replies 2009 correctly. not sure how to display the month in full or if...
2,669
Posted By magnia
this is the full script, its going into an...
this is the full script, its going into an infinite loop


#!bash


logFile=~/access/access.log

searchParam="/$1 "
grep "$searchParam" $logfile
2,669
Posted By magnia
returns nothing logFile=~/access/access.log ...
returns nothing

logFile=~/access/access.log

searchParam="/$1 "
grep "$searchParam" $logfile
2,669
Posted By magnia
grepping a variable
I need to pass a parameter that will then be grepped.

I need it to grep /paramater and then have a space

so if 123 was passed my grep would be grep '/123 ' sample.log

this works fine from...
3,913
Posted By magnia
do i need to set file1=report.log outside the...
do i need to set file1=report.log outside the variable still.

report.log is in the same directory i will be running my script from.

can i not set report.log to a variable and then use that...
3,913
Posted By magnia
assingn a variable a filename and then reading it in
Im trying to set a filename to a variable and then read the file in using the variable but im getting a syntax error. any ideas?

#!/bin/bash



function scanFile()
{
while read $1
...
2,619
Posted By magnia
trying to store variables in an array
im looping through an array setting three variables each time (one of the variables gives me the position in the array and is incremented each loop)

im trying to then set the variables to that...
6,391
Posted By magnia
what does this sed do?
Could someone explain what substitute this sed does?

s/^.*:://
1,802
Posted By magnia
thanks for your help thats working now :)
thanks for your help thats working now :)
1,802
Posted By magnia
sed error
im getting this error when i try to run this function.

/home/bob.murray/directory1
sed: -e expression #1, char 9: unknown option to `s'
sed: -e expression #1, char 9: unknown option to `s'

...
3,034
Posted By magnia
checking if parameter passed is a number
I have written a function that fills an array and another function where if a parameter is supplied it will jump to that part of the array and cat it to the screen.

I need to put in some checks to...
Showing results 1 to 16 of 16

 
All times are GMT -4. The time now is 12:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy