New answers tagged

1

Consider using cut instead of sed: cut -c-10 This example extracts 10 first characters from the beginning of the line.


3

As stated by @chicks the shell is interpreting the && part without sudo so doing: sudo /home/ec2-user/letsencrypt/letsencrypt-auto --config /home/ec2-user/letsencrypt/cert.ini certonly --debug && sudo service httpd reload Sorts the problem


0

Single Bracket i.e. [] For comparison ==, !=, <, and > and should be used and for numeric comparison eq, ne,lt and gt should be used. Enhanced Brackets i.e. [[]] In all the above examples, we used only single brackets to enclose the conditional expression, but bash allows double brackets which serves as an enhanced version of the single-bracket ...


1

@Iain is correct that this script is likely not doing what you need, however in general if you're looking to compare strings you're missing an equalsign, this would probably work better: if [ "$CHECK_SYSTEM" == "Product Name: VMware Virtual Platform" ] ; then See this excellent thread for more: ...


2

Use echo to inspect the $CHECK_SYSTEM string returned by your command, it is not what you think it is. You will need to further process it to remove some whitespace. You may find the virt-what command more useful if it is installed on the system e.g. # virt-what vmware or # virt-what kvm virt-what is a shell script so you can easily add a copy to ...


0

Assuming from your question you are using a linux machine as host... You can use unix file permission to achieve this. Make sure that the chmod's for folders are only accessible by the correct user for that site. This means removing any read/write permissions from "other" or from "group". To view current permissions on a file or folder, type: stat ...


0

This is most likely an issue with reduxframework which may be a WordPress plugin, or included by a WordPress theme. To find it try something like that: grep -rniIlF 'info-html' wp-content/ This will give you the file and line number where you should find something like: $sampleHTML = $wp_filesystem->get_contents( dirname( FILE ) . '/info-html.html' ); ...


0

the test tool can check for this (from the man page): -t FD True if FD is opened on a terminal. So you can use for example: if [ -t 0 ] ; then echo stdin is a terminal ..... fi or if [ -t 1 ] ; then echo stdout is a terminal fi


2

You need to set the PATH at the beginning of the script or use the full path to protractor. cron uses a default PATH while yours is likely modified by some rc file.


0

no. There is no way to run remote windows applications over ssh. There is no protocol that would support that (unlike on Linux, where is still the ancient X11). If you want to play with Windows windows, use RDP or how is that thing called. Even if you are not interested in the actual window, the cygwin is running in different session (I hope windows has ...


0

I found working solution here: https://af-design.com/2009/07/07/loading-data-into-bash-variables/ if [ -f "$SETTINGS_FILE" ];then . "$SETTINGS_FILE" fi


0

root@lab7-dl380-11:~/> cat test 16G 754G 457M 346M 77G 654M root@lab7-dl380-11:~/> awk '{for(i=1;i<=NF;i++)if($i ~ /M/)printf $i/1024 "G\t"; else printf $i "\t"; print ""}' test 16G 754G 0.446289G 0.337891G 77G 0.638672G Also you can round to hundredth for smarter output root@lab7-dl380-11:~/> awk ...



Top 50 recent answers are included