New answers tagged

0

If you need the html sent as attachment, then you can use the shell tool called mpack. http://linux.die.net/man/1/mpack EDIT FOR SAMPLE: I as a simple user send a dummy mail to root with /etc/hosts attached: $ mpack -s 'trx of /etc/hosts' /etc/hosts root@localhost and as root, I'm checking my box: # mail Mail version 8.1.2 01/15/2001. Type ? for ...


-1

If you have X running, you can write a tiny X code (e.g. in Tcl/Tk or Tkinter) that sends the password to stdout. Then all you have to do is set the environment variable SSH_ASKPASS to the path of that code. from man ssh: SSH_ASKPASS If ssh needs a passphrase, it will read the passphrase from the current terminal if it was run ...


0

Following VBA Code will move copy of the incoming Email and mark it UnRead Create Rule and Apply on messages I receive -> Next -> Next -> Run Script Option Explicit Public Sub MoveItems(olItem As Outlook.MailItem) Dim olApp As New Outlook.Application Dim olNameSpace As Outlook.NameSpace Dim olInbox As Outlook.MAPIFolder Dim olDestFolder As ...


0

One simplistic way is spawning a new shell at the end of your script. Just put the command bash as the last line in your view_log.sh script. It's not pretty, as you normally don't want to open another subshell, but it keeps the original window open.


1

WinSCP scripting does not support parallel transfers on its own. But you can run multiple WinSCP scripts in parallel. You just have to split the set of files/directories to batches. There's actually a ready-made PowerShell script based on WinSCP .NET assembly that does this. See Automating download in parallel connections over SFTP/FTP protocol. You can ...


1

When I wanted it set up, I wanted a very low-latency approach so I could get a splash screen going. For task scheduler you want to set the trigger to "on an event" then set to custom rather than basic, then edit the query manually under event trigger's XML tab. I tried this script for XML: <QueryList> <Query Id="0" Path="System"> ...


1

There's so many ways for achieving this. I'll stick to the ones that uses Notepad++ for now Notepad++ > Search > Find in Files and go from there adjust the mask or make backups, and read your option this WILL replace all files in sub folders by default OR for more advanced search and replace Notepad++ > Plugins > Plugin Manager > Show Plugin Manager now ...


0

Step 1: Press “Alt-F11” to open the Microsoft Visual Basic for Application window. Step 2: Click Module on the Insert tab, copy and paste the following VBA code into the Module window. Step 3: Then click Run (F5) button to apply the VBA. VBA: searching and replacing same content across multiple documents at one time Sub CommandButton1_Click() Dim ...


0

I've written my own Android script, which moved some files to a folder automatically. What I did was: Write your script starting with #!/system/bin/sh. I used simple bash commands. Save your script without any file extension. Your phone will automatically know it's a shell script. Connect your phone to USB and type the following in a cmd: adb push ...


0

The problem is that you have a \n in your first printf. That makes the cursor move to the next line, so when you print the new text it is not on the same line to overwrite the old text. If you remove that you should be good: COLUMNS=$(tput cols) printf "%*s\r" $((COLUMNS/2)) "Hey, welcome to my script!" sleep 2 printf "%*s" $((COLUMNS/2)) "This is a new ...


0

ok solved. Thx. do shell script ("/usr/local/Cellar/id3lib/3.8.3_1/bin/id3tag " & " -A HHHHHHH " & file_path)


1

Building on the previous answer, but instead of using GNU parallel, using the standard command "xargs" with option -P option: seq -f '%03.0f' 0 999 | xargs -n 1 -P 4 python Try this to see how the processes run in parallel: seq 0 10 | shuf | xargs -n 1 -P 3 -I % sh -c "echo start %; sleep %; echo done %"


1

Send E-Mail from Powershell Script to Multiple Recipients based on ActiveDirectory User This format needs to be converted to the multiple recipient example as shown above. I am at a loss at how to properly grab the data, format it and be sure it stays in the format that Send-Mailmessage can use. There needs to be a way that grabs the ...


0

I set up a loop. while return status is 0 increment a variable with addition and print the variable to stdout I started it just under 2^31, I let it pass both 2^31 and 2^32 with no issue, stopped it, then set the initial value to just under 2^63. The result was that it seamlessly rolled over from 9.22e18 to -9.22e18 and continued to increment positively. ...


1

Don't start Android Studio directly, but start it by command-line example.cmd script: @echo off start /W drive:\your\path\to\android_studio.exe rem git commit + push here Create/change Android Studio shortcut to execute your script: cmd /C drive:\your\path\to\example.cmd


2

It may come down to your version of bash, your OS, and your CPU architecture. Why don't you try it yourself? Set a variable to (2^31)-1, then increment it, set it to 2^32, then increment it, set it to 2^64, then increment it, etc. Here, I just tried it myself on my Core i7 Mac running OS X "El Capitan" v10.11.3, and it looks like bash is using signed 64-bit ...


0

You can write a script as background thread and check whether the process Android Studio there. You can try Python script too but you should NOT use psutil it's resource intensive.


0

Ansible is an IT automation tool that can do remote execution and orchestration. You can use the script module for your use case.


1

source allows you to execute a command in the current context (arguments $* are part of context). The second source call overwrites these arguments. Note it overwrites them only for the call, they are restored right after.


0

Assuming you're interested in changing the shell used in mintty/Cygwin Terminal, it first checks the SHELL environment variable, then the (now nonexistent) passwd file, then falls back to /bin/sh, which is what it seems to be doing by default. I was able to set the SHELL environment variable in Windows to /usr/bin/zsh and it worked without any other ...


1

Since comments suck for formatting, please verify this is the correct input/output format desired: InputFile.txt: Iamline1 Iamline2 Iamline3 GrouponeEndswithme Group2startshere Thisisgroup2line2 OUTPUTFILE.txt: Iamline1Iamline2Iamline3GrouponeEndswithme Group2startshereThisisgroup2line2 In this case your output file with ALL groups is still only ONE ...


1

How can I set the result of the following command to be a variable called model? wmic computersystem get model The output of this on my system is: Model VPCF22L1E Note the extra blank line. I've used VPCF22L1E to test the batch file. Use the following batch file (test.cmd): @echo off setlocal enableDelayedExpansion for /f "usebackq skip=1" %%i in ...



Top 50 recent answers are included