Search Results

Search: Posts Made By: sleepster
2,208
Posted By sleepster
is there a command using iptables?
is there a command using iptables?
2,208
Posted By sleepster
Firewalls
Hi,

I was doing abit of reading on firewalls when this question came up.

Is there any command which sets up a firewall that will only allow packets through if they come from a port number less...
23,376
Posted By sleepster
yes Ygor, that almost does it could you...
yes Ygor, that almost does it

could you explain what the symbols [ ] and * mean here?

also what if there are spaces in front of and behind the line?

" Amy Reds , 100 , /bin/sh "

thanks
23,376
Posted By sleepster
thanks for your reply i am using vi to do...
thanks for your reply

i am using vi to do this.. i tried sed and it does not give me the output i want.. Amy Reds , 100 , /bin/sh --> would give me an output without any spaces in between
...
23,376
Posted By sleepster
Leading and Trailing Spaces
Hi,

how to i remove leading and trailing spaces from a line? the spaces can be behind or in front of any field or line

example of a line in the input data:

Amy Reds , 100 , /bin/sh...
3,905
Posted By sleepster
Creating usrname in /etc/passwd file
I want to create a usrname field for /etc/passwd file consisting of the first letter of the first name and the first 7 letters of the second name. I have got this so far -->

awk -F, '{print...
9,896
Posted By sleepster
I am writing a script to process a file to add...
I am writing a script to process a file to add entries to /etc/passwd
9,896
Posted By sleepster
What if the group name is stored in a variable.....
What if the group name is stored in a variable.. say $X?

I tried: awk -F: '$1 ~ $X {print $3}' /etc/group... didnt work
the code works fine with /dev/ though
9,896
Posted By sleepster
thanks butterfm.. but what if "dev" appears...
thanks butterfm..

but what if "dev" appears in some other field in another entry in /etc/group.. say for example there is a member of another group by the name of "dev"

then when the grep...
9,896
Posted By sleepster
Getting information from /etc/group
How can I retrieve the group id of an entry in the /etc/group file given the group name?

I tried using cut and grep but cant get around the problem..

I think this problem can be solved using...
9,410
Posted By sleepster
Letters, Numbers or Alphanumerical
How do I check if a variable consisted of letters, numbers or both letters and numbers?

For example, I have a variable $X and I want to print "1" if it contains only letters, "2" if it contains...
7,681
Posted By sleepster
Yes.. I tried directed the output to another file...
Yes.. I tried directed the output to another file to..

thanks
55,767
Posted By sleepster
Using cat command in a for loop
If I have a data file containing entries like-> abc abc:123

and I use a for loop:

for I in `cat data-file`
do
echo $I
done

the output would contain 2 lines -> abc.... and abc:123

but...
7,681
Posted By sleepster
thanks alot butterfm.. one last question: ...
thanks alot butterfm..

one last question:

{ $1,$2 and $3 are only valid inside these brackets right? }

so how can I make use of these variables outside Awk?
7,681
Posted By sleepster
My input file would contain lines looking...
My input file would contain lines looking something like:
John Doe,users,/bin/sh

So given this, I want to create an entry for the etc/passwd file, where the user name contains the first char of...
7,681
Posted By sleepster
Creating an entry for /etc/passwd
given an input file containing fields seperated by "," how do I retrieve information of these fields, do some work on them, then create a new input to the etc/passwd file?

someone told me to look...
Showing results 1 to 16 of 16

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