11-10-2009
Thanks Scrutinizer....Understood much better now..
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
i have a simple question:
in hpux 11i;
this cmd :
cat mailtest |grep sekar >test1
gives the output file with the name test1.
i want to remove the line which contains the "sekar" and put the result in the new file....
what is the command for that?.. (2 Replies)
Discussion started by: sekar sundaram
2 Replies
2. Shell Programming and Scripting
Hi
Is there a way to cut the last two characters off a word or number given that this word or number can be of varying length?
I have tried something like
TEST=`echo $OLD | cut -c 1-5`
where $OLD is a variable containing a number like 1234567 which gives a result of 12345. This is fine... (4 Replies)
Discussion started by: rleebife
4 Replies
3. Shell Programming and Scripting
Hi, I'm very new to scripting.
grep $s $filename | awk '{print $2}' | cut -c 1-8
How can I optimize this using a single awk?
I tried:
awk '/$s/ {print $2}' $filename | cut -c 1-8
However didn't work, I think the awk is not recognizing $s and the verbal is something else. (6 Replies)
Discussion started by: firdousamir
6 Replies
4. Shell Programming and Scripting
I have been reading for a few hours trying to educate myself enough to accomplish this task, so please know I have performed some research. Unfortunately, I am not a *NIX scripting expert, or a coder. I come from a network background instead.
SO, here is my desired outcome. I have some Cisco... (5 Replies)
Discussion started by: abbzer0
5 Replies
5. UNIX for Dummies Questions & Answers
Hi,
From the file "example" with lines like below, I need the int value associated with ENG , i.e, 123
SUB: ENG123, GROUP 1
SUB: HIS124, GROUP 1
..
..
Normally , i do
grep ENG example | cut -d ' ' -f 2 | cut -c 4-6
Is it possible to do it in simpler way using awk/sed ?
... (5 Replies)
Discussion started by: priyam
5 Replies
6. Shell Programming and Scripting
hi people,
I have a text file containing data, seperated by TAB. I want to process this tab'ed data as variable. how can I assign this?
Ex:
Code:
11aaa 12000 13aaa 14aaa 15aaa 16aaa 17aaa
21aaa 22000 23aaa 24aaa 25aaa 26aaa 27aaa
31aaa 32000 33aaa 34aaa 35aaa 36aaa 37aaa... (1 Reply)
Discussion started by: gc_sw
1 Replies
7. Slackware
not sure how to do it. wan't to delete it using cut and grep ince i would use it in the shell.
but how must the command be?
grep "64.233.181.103 wwwGoogle.com" /etc/hosts | cut -d
the delimeter is just a space. can you help meplease. :D (1 Reply)
Discussion started by: garfish
1 Replies
8. Shell Programming and Scripting
This is my command-line code in my script,
passwd=`grep $passwd $userfile | cut -f2 -d: login_users > retrieve`
the
cut -f2 -d: login_users > retrieve
searches and prints the whole column two. what I need is one of the items in the column two only.. what option can I add to my cut... (2 Replies)
Discussion started by: jenimesh19
2 Replies
9. Shell Programming and Scripting
I have a file and need to only select users that have a shell of “/bin/bash” in the line using awk or sed please help (4 Replies)
Discussion started by: boyboy1212
4 Replies
LEARN ABOUT CENTOS
sidput
avc_context_to_sid(3) SELinux API documentation avc_context_to_sid(3)
NAME
avc_context_to_sid, avc_sid_to_context, avc_get_initial_sid - obtain and manipulate SELinux security ID's
SYNOPSIS
#include <selinux/selinux.h>
#include <selinux/avc.h>
int avc_context_to_sid(security_context_t ctx, security_id_t *sid);
int avc_sid_to_context(security_id_t sid, security_context_t *ctx);
int avc_get_initial_sid(const char *name, security_id_t *sid);
DESCRIPTION
Security ID's (SID's) are opaque representations of security contexts, managed by the userspace AVC.
avc_context_to_sid() returns a SID for the given context in the memory referenced by sid.
avc_sid_to_context() returns a copy of the context represented by sid in the memory referenced by ctx. The user must free the copy with
freecon(3).
avc_get_initial_sid() returns a SID for the kernel initial security identifier specified by name.
RETURN VALUE
avc_context_to_sid() and avc_sid_to_context() return zero on success. On error, -1 is returned and errno is set appropriately.
ERRORS
ENOMEM An attempt to allocate memory failed.
NOTES
As of libselinux version 2.0.86, SID's are no longer reference counted. A SID will be valid from the time it is first obtained until the
next call to avc_destroy(3). The sidget(3) and sidput(3) functions, formerly used to adjust the reference count, are no-ops and are depre-
cated.
AUTHOR
Eamon Walsh <ewalsh@tycho.nsa.gov>
SEE ALSO
avc_init(3), avc_has_perm(3), avc_cache_stats(3), avc_add_callback(3), getcon(3), freecon(3), selinux(8)
27 May 2004 avc_context_to_sid(3)