shell

How to exclude some files from the loop in shell script [duplicate]

人走茶凉 提交于 2021-02-11 15:37:54
问题 This question already has answers here : for-loop for every folder in a directory, excluding some of them (5 answers) Closed 12 months ago . #! /bin/sh for file in $Files/*.txt; do chmod 777 $file done It will give permission 777 to all .txt files but I've 7 other .txt file for which I don't want to give 777 permission. How can I do that? 回答1: you can add a conditional check as below. As there's no clear attribute differentiating the files you want to exclude, you'd need to specifically check

Is there an ADB command to check a media is playing or not

时光怂恿深爱的人放手 提交于 2021-02-11 15:18:16
问题 I want to check whether the Audio/Video is playing in my external device which is rooted in terminal using ADB command.I am not able to find any ADB commands if available mention that I have tried adb shell dumpsys media.player i want a command to specify if video is running or not 回答1: I think there is no direct command to do that. But you can query all the running service using adb shell service list | grep 'media.player' 回答2: To print out the MediaPlayer states: adb shell dumpsys audio But

How can find similarity between sentences? [closed]

依然范特西╮ 提交于 2021-02-11 14:54:40
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last month . Improve this question I'm trying to find similarities between both the sentences in a shell script. Have a two sentences containing duplicate words, for example, the input data in file my_text.txt Shell Script. Linux Shell Script. The intersection of both sentences: Shell + Script The union " size "

Shell Command in VBA Execution

丶灬走出姿态 提交于 2021-02-11 12:42:33
问题 I'm trying to run two lines of commands using shell. I haven't been able to find a good source on how to actually execute shell in VBA. So far, I have been able to figure out how to open a specific directory. Sub shellCMD() Shell ("cmd.exe /k CD\Users\n808037\Desktop\OTHER") End Sub This will at least lead me to the directory where I need to go. However, now that I've gotten to the directory I need to go, I need to execute a command after. That is copy *.csv merged.csv How do I do this in

Visual Basic Shell Administrator?

丶灬走出姿态 提交于 2021-02-11 12:35:11
问题 If I'm using Visual Basic to run an executable using the Shell() command, how would I run that executable as an administrator? My method works, at least in practice, but one executable won't run properly and I think that's the issue. Here's an example of the command I'm trying to run. Shell("%temp%\ninite.exe") Edit: Sorry, this is VB.net, not VBA. I put a bad tag on there. 回答1: To stay strictly in VBA with no .NET dependencies, you should be able to use the ShellExecute Win32 function.

Visual Basic Shell Administrator?

五迷三道 提交于 2021-02-11 12:35:05
问题 If I'm using Visual Basic to run an executable using the Shell() command, how would I run that executable as an administrator? My method works, at least in practice, but one executable won't run properly and I think that's the issue. Here's an example of the command I'm trying to run. Shell("%temp%\ninite.exe") Edit: Sorry, this is VB.net, not VBA. I put a bad tag on there. 回答1: To stay strictly in VBA with no .NET dependencies, you should be able to use the ShellExecute Win32 function.

How do I Run Docker cmds Exactly Like in a Dockerfile

試著忘記壹切 提交于 2021-02-11 12:33:31
问题 There seems to be a difference between how Docker runs commands in a Dockerfile versus running commands manually after starting a container. This seems to be due to the kind of shells you can start, a (I assume) non-interactive shell with a Dockerfile vs an interactive one when running something like docker run -it <some-img-id> . How can I debug running commands in a Docker container so that it runs exactly like the commands are run from a Dockerfile? Would just adding /bin/bash --noprofile

Why would one run cat|bash before copying/pasting into a terminal?

。_饼干妹妹 提交于 2021-02-11 12:22:28
问题 I've seen someone running cat|bash before pasting commands from the clipboard into a terminal. bash executes commands in bash I do not know why do we need cat here and |(pipe) . What useful effects does this practice have? 回答1: It was my colleague who executed a bunch of command in the terminal, [...] he did cat|bash before pasting those set of commands He likely this to stop Bash from interpreting anything in the commands as editing input, to override any special keybindings and aliases he's

How to divide specific column with rest of columns

泄露秘密 提交于 2021-02-11 12:18:24
问题 I have matrix like this (first column names rest are values, separator i tab): name1 A1 B1 C1 D1 name2 A2 B2 C2 D2 Matrix could be huge (it is mean about hundreds rows and columns). It is allays same size. I can expect zero values. I need output like this: name1 A1 B1 C1 D1 A1/B1 A1/C1 A1/D1 name2 A2 B2 C2 D2 A2/B2 A2/C2 A2/D2 This combination save to new file. And then make another combination: name1 A1 B1 C1 D1 B1/A1 B1/C1 B1/D1 name2 A2 B2 C2 D2 B2/A2 B2/C2 B2/D2 and so on so on => divide

Make “python” run python3 at the prompt [duplicate]

。_饼干妹妹 提交于 2021-02-11 12:18:24
问题 This question already has answers here : How can I make the “python” command in terminal, run python3 instead of python2? (6 answers) Closed 1 year ago . I have two python installations.. python --> /Users/fraz/anaconda/bin/python (python2.7) python3.7 --> /usr/local/bin/python3.7 Now.. I want reassign the commands. Such that python points to python3.7 --> /usr/local/bin/python3.7 and python2 points to python2.7 /Users/fraz/anaconda/bin/python How do i do this reassignment? 回答1: follow this