su - root -s $SHELLPATH
root users will report an error when executing, and permission denied
pops up.but use
directlysource $SHELLPATH
can be executed
what is the reason for this?
Thank you.
su - root -s $SHELLPATH
root users will report an error when executing, and permission denied
pops up.but use
directlysource $SHELLPATH
can be executed
what is the reason for this?
Thank you.
running the script directly requires the file to have execute
permission for the current user. The source
command is not required, and source only needs read permission.
you can use
chmod +x yourscript.sh
to set execution permissions
the existing format is as follows: Mon Mar 26 17:43:17 2018 this format is required: 2018-02-21 00:00:00 is there any way to convert it? ...
I do front-end development, the company develops under linux environment, I install centos6.9 through virtualbox in windows system, use virtualbox to set up a shared folder ( sudo mount-t vboxsf centosShare ~ centosShare ), and can modify fi...
Shell PHP the shell script is as follows cro_file=$dir_or_file" crontab_php" -sharp if [ -f $cro_file ] then -sharp cat cat $cro_file else echo "$cro_file not found." fi crontab_php conten...
as shown in the figure, the ifconfig command can obtain the traffic information of multiple network cards, and now you need to separate the two. Excuse me, what shell command can separate the information of multiple network cards from ifconfig? I trie...
I just looked it up briefly, and I think I got it from some files under the proc directory. I ve seen that the most possible proc pid status file doesn t have shared memory, so I guess it was obtained through some kind of calculation, asking for a...
as the following example: I want to replace packet in the line that contains bytes with bytes . **rx_bytes2_blob = BlobField( rx proto2 packets , item_type = int)**--->rx_bytes2_blob = BlobField( rx proto2 *bytes* , item_type = int) ...
Log in to centos7 with xshell when configuring the Nginx server recently. When configuring the etc nginx nginx.conf file. look at the picture first vimvi() is also complete and no upper part is lost. If you know anything, please let me know. T...
the server runs the meshlabserver command, but an error is reported Google has some methods, but it hasn t been successful yet. is there any way to get this command running? I appreciate your advice! ...
at present, I am implementing such a shell, that can successfully log in without secret, but cannot cd to data bak log, for advice -sharp! usr bin expect set timeout 30 spawn ssh -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2] expect { ...
definition of shell: -sharp! bin bash res=`2222222222 | md5sum | cut -d -f1` echo "res: " ${res} write in a file and run the result as follows: . sh-test.sh: line 3: 2222222222: command not found res: d41d8cd98f00b204e9800998ecf842...
my project will use webp image format, because I am a novice, so I can not find on the Internet can directly use the java library to convert picture format bit webp, but google provides a conversion tool that can be run under linux, so I intend to use t...
the problem I have now is that, for example, I compiled and packaged a file in centos An and sent it to centos B. what I have done at present is through the scp command to add the id_rsa.pub of An in B ssh and rename it to authorized_keys,. Now the rem...
the remote linux system has large files that need to be retrieved locally. used lrzsz s sz command and sftp s get command. Do not know how to break point to resume transmission, every time the shutdown will continue to overwrite the previous or retran...
for example: restrict user A to run nginx (or other services) only on specific ports (such as 8080) ...
I wanted to use PHP to execute Linux sed to insert a document, but php currently doesn t have permission to execute shell commands. excuse me, how to implement this requirement with php code? ...
for example grep 20180906834424 test.log | awk {print $2} the above code will produce a result. How can I use this result as a parameter of grep to re-search the test.log file? grep 20180906834424 test.log | awk {print $2} | xargs grep PATT...
The Linux view command looks at files, such as xml, why there is no syntax highlighting? vi check for syntax highlighting. How can view turn on syntax highlighting? ...
because you have switched to the user on the other side of the server, is there any good solution? Thank you. ...
cannot press enter when expect is running? script such as -sharp! usr bin expect set timeout 30 spawn bash centos7_client.sh expect { "sharon@192.168.27.156 s password:" {send "pwd r" ; exp_continue } } expe...
windows system, the computer has a fixed network to connect to the company s internal network, and wifi to connect to the external network. wants to make a switching device. If the wifi is already connected to the public network, then netsh wlan discon...