11.04.2013 Views

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appen<strong>di</strong>ce K. Un esempio <strong>di</strong> file .bashrc<br />

elif [ "${cspec#*-[abcdefgjkvu]}" != "" ]; then<br />

# complete -[abcdefgjkvu]<br />

#func=$( echo $cspec | sed -e ’s/^.*\(-[abcdefgjkvu]\).*$/\1/’ )<br />

func=$( echo $cspec | sed -e ’s/^complete//’ -e ’s/[^ ]*$//’ )<br />

COMPREPLY=( $( eval compgen $func $cur ) )<br />

elif [ "${cspec#*-A}" != "$cspec" ]; then<br />

# complete -A <br />

func=${cspec#*-A }<br />

func=${func%% *}<br />

COMPREPLY=( $( compgen -A $func $cur ) )<br />

fi<br />

else<br />

COMPREPLY=( $( compgen -f $cur ) )<br />

fi<br />

}<br />

complete -o default -F _my_command nohup exec eval trace truss strace sotruss gdb<br />

complete -o default -F _my_command command type which man nice<br />

# Local Variables:<br />

# mode:shell-script<br />

# sh-shell:bash<br />

# End:<br />

805

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!