An automated series of instructions carried out in a specific order, such as a Windows script created to launch a specific program on startup.

learn more… | top users | synonyms (1)

0
votes
0answers
20 views

How to recover the original file content after using Script command on the file in Linux

I have a file named file1.txt in Linux.  By mistake, I used the script command, script file1.txt its goal is to add all the terminal output to the file1.txt.  Now file1.txt is with unreadable ...
0
votes
1answer
17 views

Delete first line from a file and Update

Here is the file i work on "list": g-8.xx.yyy.zzzz g-9.xx.yyy.zzzz g-10.xx.yyy.zzzz g-11.xx.yyy.zzzz g-12.xx.yyy.zzzz Here is the script i try to complete ( i'd like to get the first line and ...
0
votes
1answer
40 views

Windows batch file deletes and recopies files WAY too fast - should take 15+ seconds, takes < 1 second. Why?

I wrote a script that checks to see if a folder exists, and if so, empties it. it then waits 5 seconds, then proceeds to recopy new (or maybe the same) files back into the folder. When the folders ...
0
votes
1answer
16 views

Vimperator — Custom ExtendedHit to launch script/program on matching regex

I want to define a custom extendedhint in vimperator that: Matches a regex pattern Feeds that match to a script as such: ~/bin/script regex-match-as-arg Where should I start solving this problem? ...
0
votes
1answer
23 views

How to create batch script to keep rerunning command

I just downloaded Win 10 and I'm having activation issues. I hear if I keep rerunning this - "slmgr.vbs /ato" command it will eventually activate. Can someone give me a quick little script to have ...
0
votes
0answers
10 views

Serial connection over PuTTY and -m?

I am using a com port to connect to a device. I would like to run a script that does 3 commands for me. Currently I'm trying to do "start putty.exe -load temp1 -m script.txt" All of that is in the ...
6
votes
4answers
3k views

Hook into linux mount/umount event

is there a way to provide post-mount and pre-umount scripts in Linux? I am trying to do some scripts on storage media when mounted and before umounting (eg, for synching). Any help appreciated.
1
vote
2answers
4k views

How to auto commit to my git repository using cron?

I look into a lot of answers about this subject, but something is wrong here, let me explain. I create this script, to make my cron cleaner :) #!/bin/bash cd ...
3
votes
2answers
219 views

How to properly restore settings when running a script using “source”?

I'm writing a script that needs to be executed using source, because its task is to modify the environment. During the script, I want to use set -e so that any error stops the script. The script looks ...
0
votes
0answers
12 views

Batch copy files from client list to my server

Could you help me to create batch file to get information from client to server. I have 10 clients such as 1. CU01 2. CU02 3. CU03 . . . 10.CU10 I would like to copy file from 10 clients on ...
0
votes
3answers
37 views

Is there a way to run Javascript without a browser, like a shell or batch script?

Is there a way one could run Javascript the way Python, Bash, Windows Batch or other scripting languages are run? File access and other library functions would be nice but are not required - I'm just ...
3
votes
2answers
18k views

Automate file upload in Filezilla using script

D:\Program Files\FileZilla FTP Client\filezilla.exe -c 0/GG/DG/ -a "K:\YY\XXXXX\AAAA\BB\idS.txt" This code doesn't work as it says "PATH NOT FOUND" K:\YY\XXXXX\AAAA\BB\idS.txt However D:\Program ...
0
votes
0answers
12 views

How to get file path of selected file in Finder into clipboard? Issue with Jumpcut

I used to be able to get the file path from any selected file in Finder by hitting a keyboard shortcut. I'm running an automated script that takes Files and Folders in Finder and uses the built-in ...
0
votes
2answers
20 views

Continuously check status of OpenVPN connection

I'm trying to check and display the status (connected/not connected) and the server's hostname/cn of an OpenVPN connection that should connect at every boot. Now I've found out that in ...
4
votes
1answer
1k views

What scripting/programming languages are default on Mac OSX?

I was wondering what programming or scripting languages come pre-installed on OSX? Particularly programs that can be run from the command line. I'm planning on parsing some CSS, and outputting an ...
1
vote
4answers
795 views

Some websites prompt to download PHP script after some time, but only in Firefox

This happens only in Firefox - NOT in IE or in Safari (all 3 tested only on a Windows system). Always, viewing a page shows most of the content, and then the browser prompts to download some sidebar ...
0
votes
0answers
29 views

PowerShell script to monitor files in multiple folders

Can anyone help me with the PowerShell script below to monitor files in multiple folders (like D:\test1 and D:\test2 and D:\Test3)? SET FOLDER TO WATCH + FILES TO WATCH + SUBFOLDERS YES/NO $watcher = ...
0
votes
1answer
3k views

Rename a Mapped Network Drive via CMD

I map a network drive via command line. Once this drive is mapped, it appears under My Computer with the full path. How can I rename the mapped drive using command prompt? I have used the "full ...
0
votes
2answers
20 views

Command host with awk

Please, why "echo" instruction: iphost="$(ssh root@$machine -x "host $machine | awk '/has address/ { print $4 }'")" echo $iphost display: g-3.xx.yyy.zz has address 172.16.65.35 instead of: ...
0
votes
2answers
45 views

How can i get the hostname of the machine i work on?

Please, how can i get the hostname (fully qualified domain name) of the machine i work on ? Here is my script: #! /bin/sh hostname=$(host $ipaddr | awk '{print substr($NF,1,length($NF)-1)}') ...
0
votes
1answer
17 views

Script Shell Storing ip address in a table

Here is my file: test.txt 172.16.65.29 172.16.65.30 Please, how can i modify this script to store all ip address in test.txt in a table. for ip in ${iparr[@]} do echo $ip done Thank you so much ...
-3
votes
1answer
24 views

How to get started with shell scripting? [closed]

My job profile requires a certain level of shell scripting and I have no idea on how would i get started with it Please suggest me with the easy ways to getting started with shell scripting. Thank ...
0
votes
0answers
15 views

Perl script to parse log file [migrated]

I want to parse my flexlm license.log file and archiving below information into another .csv file: Date Time stamp Licence checkout / checkin Feature name User name Machine The log file format is ...
0
votes
1answer
3k views

Local group policy logon startup script not executing

This is for Windows 7 I have a .bat and .vbs file in a folder. The .bat runs the .vbs script. In the Local Policy Group editor, under Windows Settings/Scripts I added a reference to the .bat file in ...
0
votes
0answers
20 views

setup vim script to execute python file

I searched SO extensively and I can't get to fix this: I'm trying to code a pathogen friendly python plugin in windows. The setup would be: In \vimfiles\bundle\plugin I have a myscript.vim with: ...
4
votes
2answers
529 views

Bash autocomplete for different directories

I've played with bash autocomplete now for a while, but couldn't find a solution for my problem. I have a project directory with subfolders like this: projects/ruby/project1 projects/ruby/project2 ...
2
votes
0answers
23 views

Logon and Logoff scripts not running

I have set SQL queries to run on logon and logoff using group policy editor. But sometimes scripts do not run. logon.bat @echo off echo INSERT INTO UPTIME(INTIME) VALUES(NOW()); > abc.sql mysql ...
1
vote
1answer
34 views

file names starting with a string in the format of *.txt give error in FOR

I have a piece in my windows batch script. It runs fine as : for /f %%C in ('Find /V /C "" ^< %SFTP_INDIR%\Location.20150528060210.txt') do set count=%%C But when run instead of a hardcoded ...
1
vote
2answers
25 views

How to hide all files in a folder via using terminal or script

I have a folder which located as /home/makgun/Desktop/a\ b so that I tried this command mv /home/makgun/Desktop/a\ b/* /home/makgun/Desktop/a\ b/.* to rename all files as .FILENAME to be hidden but ...
0
votes
1answer
30 views

How to upload all the files from local to host using Curl?

i have written a shell script to upload all files with different names in the specific path from local to host, but i have facing some issue and the files are not getting uploaded #!/bin/sh for file ...
0
votes
3answers
2k views

Batch script to append record to csv files

I have a bunch of stock data in csv's that I am backtesting trading strategies on. The problem is that my strategy buys the open market price if a signal was found yesterday, unfortunately my data is ...
0
votes
2answers
32 views

How can I break a batch script that is executing a ping without terminating the whole script?

I have a batch script that continuously pings an address and I want a way to cancel the pinging but not terminate the whole script (alternative to ctrl^C).
0
votes
1answer
31 views

How to make videos play more than 2x faster

Youtube has an option for playing videos 2x faster than usual, which I find extremely helpful for learning about various topics. But sometimes even then the video is moving too slow for my liking and ...
0
votes
1answer
39 views

PowerShell - Quasi equivalent strings are infact not equivalent?

I have a string which I'm passing into my script as an argument. For the purpose of displaying the code on here however, I have specified these manually in the code. These variables are: ...
0
votes
1answer
37 views

Rotate all video in a folder with ffmpeg?

I have a lot of videos which are recorder 90 • rotated so I want to rotate all videos 90 degrees clockwise direction. If this possible? I used for loop but there is some mistake because of spaces ...
1
vote
2answers
27 views

Powershell: Dir /s - Remove Repeated Folders

Situation: In Powershell, I'm using: $folders = dir -s C:\Users\Name\Downloads\*.ttf | Select Directory foreach ($folder in $folders) { echo $folder } To display folders whose contents ...
1
vote
0answers
22 views

Auto Accept Twitter Followers Requests [migrated]

I have more than 2000 follower requests. I want to approve them all. I thought the API would help, but apparently not. Is there some way to Auto Accept all follower requests with any script or ...
0
votes
0answers
22 views

Python/Powershell Script for Telnet

I'm most familiar with powershell and python so a solution which utilized either of them would be ideal. I'm also open to other ideas on resolving this issue. So I have a situation where an old ...
2
votes
3answers
82 views

difference between ${} and $() in shell script

$ echo $(date) Thu Jul 2 16:33:11 SGT 2015 $ echo ${date} $ name=foo $ echo $(name) ksh: name: not found $ echo ${name} foo Seems like ${variable} is the same as $variable. while $() is to ...
2
votes
2answers
30 views

Running bash scripts from bash script in other folder

I've got several folders (one for each month), each with a bash script savetodatabase.sh. I want to run all of them after each other, so I made a script named saveall.sh which has the following code: ...
0
votes
3answers
50 views

How to append multiple .txt files to one file without header line

I have 100,000 .txt files with format below: bygrp,colnum,beta 100005,1,0.629519434191718 100005,2,-0.500000000026516 100005,3,0.560850895321124 100005,4,0.119624318119292 100005,5,0.257676682753309 ...
0
votes
4answers
96 views

Have the command prompt launch an application like Notepad and block until it is closed

I have a Batch script I essentially want it to present the user with a notepad window opened with a configuration file for the user to edit each time they run the script, and I want the Command Prompt ...
1
vote
1answer
35 views

Redirections shell

Can anyone explain the following? :~$ ls macreave.sh fgvdvg > testo 2> testo :~$ cat testo macreave.sh ccess fgvdvg: No such file or directory :~$ ls macreave.sh fgvdvg > testo ...
1
vote
2answers
16k views

Run a batch file on a remote computer as administrator

I am trying to run a batch file (to install some software) on a remote computer. To do this, I am using PSExec. psexec.exe \\COMPUTER C:\swsetup\install.bat This works fine, apart from some of ...
2
votes
3answers
2k views

How to test stability of wireless router

I had a wireless router that would intermittently drop connections, so I had switched to using a different router. I have since updated the firmware on the problematic router. Is there an easy way to ...
0
votes
1answer
29 views

Script Shell Find each occurrence of a String in a file

Here is the structure of my file: /**** Some Text here ****/ DN 10.147.243.93 51.46 KB 256 34.2% DN 10.147.243.89 83.05 KB 256 34.6% DN 10.147.243.88 66.43 ...
19
votes
6answers
27k views

When to use Bash and when to use Perl/Python/Ruby?

We are doing all our scripting with Bash so far, but I'm starting to feel a bit silly about it. While we can of course do everything we want with Bash (it's quite powerful), I'm starting to wonder if ...
1
vote
2answers
2k views

Is it possible to autocrop black borders of a video with ffmpeg?

I think it has a "blackness" video filter, which can determine if a picture sequence is black. Maybe it also has a filter to determine crop values automatically to remove black borders form edges of a ...
4
votes
4answers
2k views

How to automatically launch a shell script when content of a given directory is changed

I'm developing a web project using some libraries that force me to launch a shell command to compile some files everytime i modify them. This task is obviously tiresome and i'm looking to find some ...
0
votes
1answer
30 views

Concat String with variable after a 'grep'

Here is the structure of my file: g-4.n.g.fr 10.147.243.63 g-4.n.g.fr-w1 Here is my sript: #! /bin/sh ip=10.147.243.63 worker=$(grep -e $ip $1 | awk '{ print $3; }') echo "[Hostname: ]" echo ...