Sponsored Content
Top Forums Shell Programming and Scripting Explaining behaviour of sudo bash "$0" "$@"; Post 303025463 by boqsc on Friday 2nd of November 2018 04:26:31 PM
Old 11-02-2018
Bash programming is a true headache for beginners. May you suggest any reference book that has this kind of explanations if there is any? Conventions, best practices?
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Solaris

The slices "usr", "opt", "tmp" disappeared!!! Help please.

The system don't boot. on the screen appears following: press enter to maintenance (or type CTRL-D to continue)...I checked with format command. ... the slices "0-root","1-swap","2-backup" exist. ...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies

5. UNIX for Dummies Questions & Answers

"Help with bash script" - "License Server and Patch Updates"

Hi All, I'm completely new to bash scripting and still learning my way through albeit vey slowly. I need to know where to insert my server names', my ip address numbers through out the script alas to no avail. I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
Discussion started by: profileuser
25 Replies

6. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

7. Shell Programming and Scripting

Expect: spawn id exp5 not open while executing "expect "$" { send "sudo su -\r" }"

Hi All, i am trying to ssh to a remote machine and execute certain command to remote machine through script. i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as expect: spawn id exp5 not open while executing "expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
FENCE_AGENT(8)						      System Manager's Manual						    FENCE_AGENT(8)

NAME
fence_virsh - Fence agent for virsh DESCRIPTION
fence_virsh is an I/O Fencing agent which can be used with the virtual machines managed by libvirt. It logs via ssh to a dom0 and there run virsh command, which does all work. By default, virsh needs root account to do properly work. So you must allow ssh login in your sshd_config. fence_virsh accepts options on the command line as well as from stdin. Fenced sends parameters through stdin when it execs the agent. fence_virsh can be run by itself with command line options. This is useful for testing and for turning outlets on or off from scripts. Vendor URL: http://libvirt.org PARAMETERS
-a, --ip=[ip] IP Address or Hostname This parameter is always required. -l, --username=[name] Login Name This parameter is always required. -p, --password=[password] Login password or passphrase -c, --command-prompt=[prompt] Force Python regex for command prompt (Default Value: ['[EXPECT]# ']) -x, --ssh SSH connection (Default Value: 1) -n, --plug=[id] Physical plug number, name of virtual machine or UUID This parameter is always required. -u, --ipport=[port] TCP/UDP port to use for connection with device (Default Value: 22) -4, --inet4-only Forces agent to use IPv4 addresses only -6, --inet6-only Forces agent to use IPv6 addresses only -S, --password-script=[script] Script to retrieve password -k, --identity-file=[filename] Identity file for ssh --ssh-options=[options] SSH options to use (Default Value: -t '/bin/bash -c "PS1=# /bin/bash --noprofile --norc"') -o, --action=[action] Fencing Action (Default Value: reboot) -v, --verbose Verbose mode -D, --debug-file=[debugfile] Write debug information to given file -V, --version Display version information and exit -h, --help Display help and exit -C, --separator=[char] Separator for CSV created by operation list (Default Value: ,) --power-timeout=[seconds] Test X seconds for status change after ON/OFF (Default Value: 20) --shell-timeout=[seconds] Wait X seconds for cmd prompt after issuing command (Default Value: 3) --login-timeout=[seconds] Wait X seconds for cmd prompt after login (Default Value: 5) --power-wait=[seconds] Wait X seconds after issuing ON/OFF (Default Value: 0) --delay=[seconds] Wait X seconds before fencing is started (Default Value: 0) --retry-on=[attempts] Count of attempts to retry power on (Default Value: 1) --use-sudo Use sudo (without password) when calling 3rd party sotfware. ACTIONS
on Power on machine. off Power off machine. reboot Reboot machine. status This returns the status of the plug/virtual machine. list List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise. monitor Check the health of fence device metadata Display the XML metadata describing this resource. STDIN PARAMETERS
ipaddr IP Address or Hostname This parameter is always required. login Login Name This parameter is always required. passwd Login password or passphrase cmd_prompt Force Python regex for command prompt (Default Value: ['[EXPECT]# ']) secure SSH connection (Default Value: 1) port Physical plug number, name of virtual machine or UUID This parameter is always required. ipport TCP/UDP port to use for connection with device (Default Value: 22) inet4_only Forces agent to use IPv4 addresses only inet6_only Forces agent to use IPv6 addresses only passwd_script Script to retrieve password identity_file Identity file for ssh ssh_options SSH options to use (Default Value: -t '/bin/bash -c "PS1=# /bin/bash --noprofile --norc"') action Fencing Action (Default Value: reboot) verbose Verbose mode debug Write debug information to given file version Display version information and exit help Display help and exit separator Separator for CSV created by operation list (Default Value: ,) power_timeout Test X seconds for status change after ON/OFF (Default Value: 20) shell_timeout Wait X seconds for cmd prompt after issuing command (Default Value: 3) login_timeout Wait X seconds for cmd prompt after login (Default Value: 5) power_wait Wait X seconds after issuing ON/OFF (Default Value: 0) delay Wait X seconds before fencing is started (Default Value: 0) retry_on Count of attempts to retry power on (Default Value: 1) sudo Use sudo (without password) when calling 3rd party sotfware. fence_virsh (Fence Agent) 2009-10-20 FENCE_AGENT(8)
All times are GMT -4. The time now is 11:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy