Sponsored Content
Top Forums Shell Programming and Scripting Extracting the values separated by comma Post 302339589 by aigles on Friday 31st of July 2009 02:36:03 AM
Old 07-31-2009
You can also use an array (bash version) :
Code:
var=/usr/bin,/usr/smrshbin,/tmp,/tmp,/opt,/test
IFS=, paths=($var)
for (( i=0; i<${#paths[@]}; i++ ))
do
   echo "[$i] ${paths[$i]}"
done

Output:
Code:
[0] /usr/bin
[1] /usr/smrshbin
[2] /tmp
[3] /tmp
[4] /opt
[5] /test

Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Splitting comma separated values into an array

I'm attempting to create a KSH array out of a string like this: ",,,value1,value2,," I have created the array but I only get two elements, one for value1 and one for value2. I have ended up with something like this but I don't like it: set -A JUNK xx=0 for i in $(print ",,,value1,value2,,"... (3 Replies)
Discussion started by: tmarikle
3 Replies

2. Shell Programming and Scripting

script to store comma separated values in different variables

Hello friends, I need ur help.I want to write a script. The script should read contents from a file namely xyz. e.g xyz abcd,1234,efgh,7854378 dhnsa,dsakjkdl,43432,ZXDsa the script should store comma (,) seperated values in different variables. Once pointer will reach end of line (\n), it should... (1 Reply)
Discussion started by: akhtar.bhat
1 Replies

3. Shell Programming and Scripting

Input Validation of comma separated values

Hello all, I am working on a script and have the first part solved of numerical input validation. Below the code validates that the input is a numerical value between 100 and 1000. If not, it errors out. Now I need to be able to read values separated by a comma. For example, instead of my... (5 Replies)
Discussion started by: LinuxRacr
5 Replies

4. Shell Programming and Scripting

To agregate Comma separated values

Hi pls help me to get the code: i have a file in which content is : 2.01304E+11 2.01304E+11 ori 2 01:00 2.01304E+11 2.01304E+11 ori 2 01:02 2.01304E+11 2.01304E+11 ori 3 01:02 2.01304E+11 2.01304E+11 ori 3 ... (7 Replies)
Discussion started by: Aditya.Gurgaon
7 Replies

5. UNIX for Dummies Questions & Answers

[solved] Comma separated values to space separated

Hi, I have a large number of files which are written as csv (comma-separated values). Does anyone know of simple sed/awk command do achieve this? Thanks! ---------- Post updated at 10:59 AM ---------- Previous update was at 10:54 AM ---------- Guess I asked this too soon. Found the... (0 Replies)
Discussion started by: lost.identity
0 Replies

6. Shell Programming and Scripting

Needs help in parsing comma separated values

hello experts, i am retrieving values in variables jobKey and jobName within my shell script. these values are returned to me within braces and i am using following command to remove those braces: jobKeys=`echo $jobKeys | sed 's:^.\(.*\).$:\1:'` jobNames=`echo $jobNames | sed... (1 Reply)
Discussion started by: avikaljain
1 Replies

7. Shell Programming and Scripting

Comma separated values to individual lines

My OS : RHEL 6.7 I have a text file with comma separated values like below $ cat testString.txt 'JOHN' , 'KEITH' , 'NEWMAN' , 'URSULA' , 'ARIANNA' , 'CHENG', . . . . I want these values to appear like below 'JOHN' , 'KEITH' , 'NEWMAN' , 'URSULA' , 'ARIANNA' , 'CHENG', .... (4 Replies)
Discussion started by: kraljic
4 Replies

8. Shell Programming and Scripting

Assign comma separated values to a variable

Hi All, I wrote a database command that queries our application and outputs a whole bunch of values to a text file. I need to assign the output to two values. Here is a sample of the output: valueOne, checkOne valueTwo, checkTwo valueThree, checkThree I would like... (9 Replies)
Discussion started by: jeffs42885
9 Replies

9. Shell Programming and Scripting

Parsing Comma Separated values to UNIX variable from PLSQL

Hi All, I'm trying to pass the comma separated values (string) returned from Plsql Procedure to UNIX variable. getting the below log message cat: -: Bad file descriptor awk: cmd. line:1: fatal: error reading input file `-': Bad file descriptor The output coming from plsql procedure is... (3 Replies)
Discussion started by: Mahesh3089
3 Replies

10. Shell Programming and Scripting

Convert fixed value fields to comma separated values

Hi All, Hope you are doing Great!!!. Today i have came up with a problem to say exactly it was for performance improvement. I have written code in perl as a solution for this to cut in specific range, but it is taking time to run for files thousands of lines so i am expecting a sed... (9 Replies)
Discussion started by: mad man
9 Replies
secadm_su_selinux(8)					     SELinux Policy secadm_su					      secadm_su_selinux(8)

NAME
secadm_su_selinux - Security Enhanced Linux Policy for the secadm_su processes DESCRIPTION
Security-Enhanced Linux secures the secadm_su processes via flexible mandatory access control. The secadm_su processes execute with the secadm_su_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier. For example: ps -eZ | grep secadm_su_t ENTRYPOINTS
The secadm_su_t SELinux type can be entered via the su_exec_t file type. The default entrypoint paths for the secadm_su_t domain are the following: /usr/(local/)?bin/ksu, /bin/su, /usr/bin/su, /usr/bin/kdesu PROCESS TYPES
SELinux defines process types (domains) for each process running on the system You can see the context of a process using the -Z option to ps Policy governs the access confined processes have to files. SELinux secadm_su policy is very flexible allowing users to setup their secadm_su processes in as secure a method as possible. The following process types are defined for secadm_su: secadm_su_t, secadm_sudo_t Note: semanage permissive -a secadm_su_t can be used to make the process type secadm_su_t permissive. SELinux does not deny access to per- missive process types, but the AVC (SELinux denials) messages are still generated. BOOLEANS
SELinux policy is customizable based on least access required. secadm_su policy is extremely flexible and has several booleans that allow you to manipulate the policy and run secadm_su with the tightest access possible. If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server, you must turn on the authlo- gin_nsswitch_use_ldap boolean. Disabled by default. setsebool -P authlogin_nsswitch_use_ldap 1 If you want to deny any process from ptracing or debugging any other processes, you must turn on the deny_ptrace boolean. Enabled by default. setsebool -P deny_ptrace 1 If you want to allow all domains to use other domains file descriptors, you must turn on the domain_fd_use boolean. Enabled by default. setsebool -P domain_fd_use 1 If you want to allow all domains to have the kernel load modules, you must turn on the domain_kernel_load_modules boolean. Disabled by default. setsebool -P domain_kernel_load_modules 1 If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default. setsebool -P fips_mode 1 If you want to enable reading of urandom for all domains, you must turn on the global_ssp boolean. Disabled by default. setsebool -P global_ssp 1 If you want to allow confined applications to run with kerberos, you must turn on the kerberos_enabled boolean. Enabled by default. setsebool -P kerberos_enabled 1 If you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default. setsebool -P nis_enabled 1 If you want to allow confined applications to use nscd shared memory, you must turn on the nscd_use_shm boolean. Enabled by default. setsebool -P nscd_use_shm 1 If you want to enable polyinstantiated directory support, you must turn on the polyinstantiation_enabled boolean. Disabled by default. setsebool -P polyinstantiation_enabled 1 If you want to support NFS home directories, you must turn on the use_nfs_home_dirs boolean. Disabled by default. setsebool -P use_nfs_home_dirs 1 If you want to support SAMBA home directories, you must turn on the use_samba_home_dirs boolean. Disabled by default. setsebool -P use_samba_home_dirs 1 NSSWITCH DOMAIN
If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server for the secadm_su_t, secadm_sudo_t, you must turn on the authlogin_nsswitch_use_ldap boolean. setsebool -P authlogin_nsswitch_use_ldap 1 If you want to allow confined applications to run with kerberos for the secadm_su_t, secadm_sudo_t, you must turn on the kerberos_enabled boolean. setsebool -P kerberos_enabled 1 MANAGED FILES
The SELinux process type secadm_su_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions. faillog_t /var/log/btmp.* /var/log/faillog.* /var/log/tallylog.* /var/run/faillock(/.*)? initrc_var_run_t /var/run/utmp /var/run/random-seed /var/run/runlevel.dir /var/run/setmixer_flag krb5_host_rcache_t /var/cache/krb5rcache(/.*)? /var/tmp/nfs_0 /var/tmp/DNS_25 /var/tmp/host_0 /var/tmp/imap_0 /var/tmp/HTTP_23 /var/tmp/HTTP_48 /var/tmp/ldap_55 /var/tmp/ldap_487 /var/tmp/ldapmap1_0 lastlog_t /var/log/lastlog.* security_t /selinux COMMANDS
semanage fcontext can also be used to manipulate default file context mappings. semanage permissive can also be used to manipulate whether or not a process type is permissive. semanage module can also be used to enable/disable/install/remove policy modules. semanage boolean can also be used to manipulate the booleans system-config-selinux is a GUI tool available to customize SELinux policy settings. AUTHOR
This manual page was auto-generated using sepolicy manpage . SEE ALSO
selinux(8), secadm_su(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) , setsebool(8) secadm_su 14-06-10 secadm_su_selinux(8)
All times are GMT -4. The time now is 09:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy