Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] Count amount of times of appearing of character before a word? Post 302631121 by FUTURE_EINSTEIN on Thursday 26th of April 2012 10:25:43 PM
Old 04-26-2012
cheers!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed X amount of times - X is dynamic

I'm trying to make a bash shell script that will allow a user to modify another file based on input they give. Maybe someone can see what I'm doing wrong here. I'm still pretty new at this... Let's say my temp file contains this: 0 1 HELLO 3 4 And here's the code: old=(0 1 3 4) new=(zero... (2 Replies)
Discussion started by: Loriel
2 Replies

2. UNIX for Dummies Questions & Answers

count amount of accounts?

Hi, I am relatively new to Unix and trying to understand as much as I can. I would like to know if it's possible to count the total number of Unix accounts? If so, can the count be done from any working directory or does it have to be specific to where the accounts are based? Thanks! (4 Replies)
Discussion started by: Trogan
4 Replies

3. Shell Programming and Scripting

Looking for a single line to count how many times one character occurs in a word...

I've been looking on the internet, and haven't found anything simple enough to use in my code. All I want to do is count how many times "-" occurs in a string of characters (as a package name). It seems it should be very simple, and shouldn't require more than one line to accomplish. And this is... (2 Replies)
Discussion started by: Shingoshi
2 Replies

4. Shell Programming and Scripting

scripting - write a script that will count the number of times a particular word

hello everyone, I'm trying to learn some scripts but i cant get my head around two of them. 1. how can i write a script that will count the number of times a particular word is used in file? 2. how can i make a script that will take me to a web page from unix? if anyone could help it... (3 Replies)
Discussion started by: BigTool4u2
3 Replies

5. Shell Programming and Scripting

How to format a character to look like an amount -solved

Hi All, I want to format the retrieved varchar2 value in the database to $9,999,999,990.00 but remained as a character value. Is it possible? Example: 378273.23 to $378,273.23 below is the code i want to implement: sqlplus -s ${USERNAME}/${PASSWORD}@${ORACLE_SID} << END1 >> $LOGFILE... (0 Replies)
Discussion started by: ryukishin_17
0 Replies

6. UNIX for Advanced & Expert Users

Count specific word or character per line

Hi, I need help regarding counting specific word or character per line and validate it against a specific number i.e 10. And if number of character equals the specific number then that line will be part of the output. Specific number = 6 Specific word or char = || Sample data:... (1 Reply)
Discussion started by: janzper
1 Replies

7. UNIX for Dummies Questions & Answers

how to count number of times each word exist in a file

I'm trying to count the number of times each word in the file exist for example if the file has: today I have a lot to write, but I will not go for it. The main thing is that today I am looking for a way to get each word in this file with a word count after it specifying that this word has... (4 Replies)
Discussion started by: shnkool
4 Replies

8. UNIX for Dummies Questions & Answers

How do I count how many times a specific word appear in a file (ksh)?

Hi Please can you help how do I count the number of specific characters or words that appear in a file? (8 Replies)
Discussion started by: fretagi
8 Replies

9. Shell Programming and Scripting

Count same word which has come many times in single lines & pars

can i get a simple script for , Count same word which has come many times in single lines & pars Eg file would be == "Thanks heman thanks thanks Thanks heman thanks man" So resullt should be Thanks = 5 heman=2 man = 1 thanks in advance :) Please use code tags for code and... (1 Reply)
Discussion started by: heman96
1 Replies

10. UNIX for Dummies Questions & Answers

[Solved] Awk: count occurrence of each character for every field

Hi, let's say an input looks like: A|C|C|D A|C|I|E A|B|I|C A|T|I|B as the title of the thread explains, I am trying to get something like: 1|A=4 2|C=2|B=1|T=1 3|I=3|C=1 4|D=1|E=1|C=1|B=1 i.e. a count of every character in each field (first column of output) independently, sorted... (4 Replies)
Discussion started by: beca123456
4 Replies
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)
All times are GMT -4. The time now is 12:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy