Sponsored Content
Top Forums Shell Programming and Scripting variable value return of multiple command Post 302552771 by anilcliff on Monday 5th of September 2011 02:20:04 PM
Old 09-05-2011
variable value return of multiple command

I wrote this script

Code:
#!/bin/bash

var=`du -sch /var/log/messages;du -sch /var/log/maillog`
echo $var

I am getting result as follows.
Code:
# sh my.sh
2.1M /var/log/messages 2.1M total 296K /var/log/maillog 296K total

I need it like below
Code:
2.1M /var/log/messages 
296K /var/log/maillog

Can anyone help?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Return Code of multiple inner executions

Need some clarification on two topics and I apologize for the long post. Topic 1). I have a PERL script which sends output to the console. This is executed like a daemon script. I would like to capture the "print" commands of the script to a log file. How can this be done. Topic 2) Within the... (9 Replies)
Discussion started by: jerardfjay
9 Replies

2. UNIX for Dummies Questions & Answers

to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's

Hi All, Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'. I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies

3. Shell Programming and Scripting

Return code of command assigned to variable

How do I evaluate the result of a command assigned to a variable?? Example: var1=`cmd` rc=$? rc will be the result of the assignment rather than cmd since it executes after. How do I evaluate the result of the command itself? Cheers..:confused: (2 Replies)
Discussion started by: browndr
2 Replies

4. Shell Programming and Scripting

Insert a line including Variable & Carriage Return / sed command as Variable

I want to instert Category:XXXXX into the 2. line something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong: sed "2i\\${n}Category:$cat\n" Sample: Titel Blahh Blahh abllk sdhsd sjdhf Blahh Blah Blahh Blahh Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies

5. Shell Programming and Scripting

Awk return variable

Hi I have 2 working script, now i'd like to get the return value from the first and give it to the 2 script (both script work correctly if I run it separately). so i think the problem is only the first line in the way i pass the variable. in the final the "print lst", is just to check the... (2 Replies)
Discussion started by: Dedalus
2 Replies

6. Shell Programming and Scripting

Can $? return multiple values?

Hi, I have a script which does something like the below: execute_some_script.sh $arg1 $arg2 `exec-some-cmd` if then; do something else do something else fi However, during some cases, there is an error saying: line xxx: [: too many arguments at the line number which has... (5 Replies)
Discussion started by: laloo
5 Replies

7. Shell Programming and Scripting

Need Multiple Return Values

Hi, I need to retrun multiple values function errorFileCreation { echo "Before" return -1 "Siva"; echo "Aftyer" } echo ${?} - This can be used to getting first value. how can i get second one. Advance Thanks... Shiv (3 Replies)
Discussion started by: rsivasan
3 Replies

8. Shell Programming and Scripting

How to store the return value of a command into a variable?

I want to store the return value of grep -c string filename into a variable, say count. How do I do that? For example if grep -c "string" "filename" shows 0 on executing it in the sh shell then I want to store this 0 in a variable. Is it possible? :D (5 Replies)
Discussion started by: navienavnav
5 Replies

9. Shell Programming and Scripting

Storing multiple sql queries output into variable by running sql command only once

Hi All, I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise. Eg : Select 'Query 1 output' from dual; Select 'Query 2 output' from dual; I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies

10. UNIX for Beginners Questions & Answers

Carriage return with cat variable

Hi, I wish to know how to works the carriage return with cat.. As a picture often speaks better than words, my code below : #te=`cat text.txt` (I tried this, but the same..) te=$(cat text.txt) echo $te My file text.txt below: BLABLABLABLABLALBLA BLABLABLABLABLALBLA ... (9 Replies)
Discussion started by: Arnaudh78
9 Replies
svc_multilog_selinux(8) 				    SELinux Policy svc_multilog 				   svc_multilog_selinux(8)

NAME
svc_multilog_selinux - Security Enhanced Linux Policy for the svc_multilog processes DESCRIPTION
Security-Enhanced Linux secures the svc_multilog processes via flexible mandatory access control. The svc_multilog processes execute with the svc_multilog_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 svc_multilog_t ENTRYPOINTS
The svc_multilog_t SELinux type can be entered via the svc_multilog_exec_t file type. The default entrypoint paths for the svc_multilog_t domain are the following: /usr/bin/multilog 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 svc_multilog policy is very flexible allowing users to setup their svc_multilog processes in as secure a method as possible. The following process types are defined for svc_multilog: svc_multilog_t Note: semanage permissive -a svc_multilog_t can be used to make the process type svc_multilog_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. BOOLEANS
SELinux policy is customizable based on least access required. svc_multilog policy is extremely flexible and has several booleans that allow you to manipulate the policy and run svc_multilog with the tightest access possible. 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 MANAGED FILES
The SELinux process type svc_multilog_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. svc_svc_t /service/.* /var/axfrdns(/.*)? /var/tinydns(/.*)? /var/service/.* /var/dnscache(/.*)? /var/qmail/supervise(/.*)? /service var_log_t /var/log/.* /nsr/logs(/.*)? /var/webmin(/.*)? /var/log/secure[^/]* /opt/zimbra/log(/.*)? /var/log/maillog[^/]* /var/log/spooler[^/]* /var/log/messages[^/]* /usr/centreon/log(/.*)? /var/spool/rsyslog(/.*)? /var/axfrdns/log/main(/.*)? /var/spool/bacula/log(/.*)? /var/tinydns/log/main(/.*)? /var/dnscache/log/main(/.*)? /var/stockmaniac/templates_cache(/.*)? /opt/Symantec/scspagent/IDS/system(/.*)? /var/log /var/log/dmesg /var/log/syslog /var/named/chroot/var/log FILE CONTEXTS
SELinux requires files to have an extended attribute to define the file type. You can see the context of a file using the -Z option to ls Policy governs the access confined processes have to these files. SELinux svc_multilog policy is very flexible allowing users to setup their svc_multilog processes in as secure a method as possible. STANDARD FILE CONTEXT SELinux defines the file context types for the svc_multilog, if you wanted to store files with these types in a diffent paths, you need to execute the semanage command to sepecify alternate labeling and then use restorecon to put the labels on disk. semanage fcontext -a -t svc_multilog_exec_t '/srv/svc_multilog/content(/.*)?' restorecon -R -v /srv/mysvc_multilog_content Note: SELinux often uses regular expressions to specify labels that match multiple files. The following file types are defined for svc_multilog: svc_multilog_exec_t - Set files with the svc_multilog_exec_t type, if you want to transition an executable to the svc_multilog_t domain. Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels. 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), svc_multilog(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) , setsebool(8) svc_multilog 14-06-10 svc_multilog_selinux(8)
All times are GMT -4. The time now is 03:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy