A script is a sequence of commands or instructions that are executed by an interpreter program rather than compiled into a standalone executable program.

learn more… | top users | synonyms (1)

5
votes
3answers
2k views

The way to use `/usr/bin/env sed -f ` in shebang?

Typing /usr/bin/env sed -f in terminal works. But if use it as a shebang, #!/usr/bin/env sed -f s/a/b/ The script will be fail to execute: /usr/bin/env: sed -f: No such file or directory I ...
4
votes
2answers
217 views

Is there a way to simulate a “Close” event on various windows using the terminal?

I answered on Ask Ubuntu Quit all instances of gnome-terminal via a command but as you all can read gnome-terminal didn't seems to have a SIGcall I could use to simulate this "Close" event. So this ...
3
votes
5answers
171 views

How can I force a script to use more resources?

I'm running a very time-consuming script which takes many hours to end. Watching top I see that it's only taking 5% of the CPU at best, usually around 3%. Is there any way to force the script to use ...
3
votes
3answers
180 views

Permissions for a submission script

I'm a TA for an introductory Python programming class (all work is done from the terminal), and I'm writing a project submission script. Ideally I want a directory setup like this: submissions/ ...
3
votes
2answers
523 views

Convert a typescript file to a list of commands (history)

I wanted to record a linux session so I could use it as documentation for a "how to install" guide. I found something on the internet that suggested that the script command would be good for this, and ...
2
votes
3answers
94 views

Extracting characters after a particular text

I am extracting a page from website using cURL command. curl "www.google.com" -s | w3m -dump -T text/html > foo.txt The w3m command outputs the HTML page in a much more simpler format so that ...
2
votes
2answers
710 views

Concatenate multiple files under subdirectories

My directory structure is given below x:\Project_2012-158A\Sample_4041 SampleSheet.csv 4041_CGTACG_L002_R1_001.fastq 4041_CGTACG_L002_R2_001.fastq 4041_CGTACG_L006_R2_001.fastq ...
2
votes
3answers
1k views

Anacron job complains “Gtk-WARNING **: cannot open display”

I'm trying to make a simple weekly Anacron job that backs up my computer if I click yes on the dialog. The script I wrote works fine if run manually, but when Anacron runs it, nothing happens and I ...
1
vote
2answers
50 views

How to notice log file changes with Linux standard tools? [duplicate]

I need something that does not need to be installed. It's on an embedded system with very little space on the HD. I can't instal anything. I need to do it with something that is already included. I ...
1
vote
2answers
713 views

How can I queue processes?

I have a surveillance camera and a program records videos when motion is detected. Basically, this program saves the video in a very heavy format. My solution was to call a script that converts the ...
7
votes
1answer
677 views

Problems running python script from motion

I'm trying to set up the raspberry pi with my webcam as a motion detecting cctv that uploads the videos to google drive using Jeremy Blythe's script I have motion working correctly and the python ...
4
votes
3answers
113 views

shell script problem with using the operators

I am comparing two strings using the levenshtein distance algorithm. I got the PHP implementation of the algorithm from here. I am calling this php implementation from my shell script as below. ...
4
votes
4answers
3k views

Can IFS (Internal Field Separator) function as a single seperator for multiple consecutive delim chars?

Parsing an array using IFS with non-whites space values creates empty elements. Even using tr -s to shrink multiple delims to a single delim isn't enough. An example may explain the issue more ...
3
votes
2answers
185 views

Exiting a pipeline if a former command fails

I'm trying to check the number of running and queued PBS jobs by parsing the output of qstat -tn1 from a bash script. So far, this has worked: count () { qstat -tn1 | awk ' BEGIN { R = 0; ...
2
votes
5answers
476 views

Why is the first line comment of .sh file necessary? [duplicate]

I was told that the first line shebang (#!/bin/bash) is necessary in the shell script file, and the file won't run accurately without this line. But I tested some scripts. They work just fine without ...
2
votes
2answers
1k views

/usr/bin/env: zsh -: No such file or directory

I get the error /usr/bin/env: zsh -: No such file or directory ...when I run an executable zsh script that starts with the following shebang line: #!/usr/bin/env zsh - Also, FWIW, replacing - ...
2
votes
2answers
84 views

Scripting to domain allocation to server

I have two text files: file #1: domain.txt cocacola.com airtel.com pepsi.com file #2: servers.txt 192.0.53.42 , 4 # 4 domains already allocated on server 192.0.53.42 192.53.1.2 , 1 # 1 ...
2
votes
3answers
222 views

What is the difference between ./script and . ./script? [duplicate]

Possible Duplicate: Using ‘.’ to execute files in bash I was trying to figure out how to export my environmental via script instead of changing my .bashrc file. I found this old useful ...
2
votes
1answer
356 views

Script for courier maildir folders on CentOS LAMP environment

I'm looking for resources to help me build a script to do monthly maintenance of maildir folders for a typical CentOS LAMP VPS hosting environment. I would like to run a script that runs from a ...
1
vote
1answer
339 views

Script Command without Junk Character

I'm Using Unix script command to record everything which is output to the terminal and place it in a log file. but when I see recorded file, it also include Junk Character. So how to record terminal ...
1
vote
3answers
292 views

tail -f equivalent

I am seeing several seconds delay with the tail command. I found the cause for it has something to do with nfs services. I am using arch linux and yet to find out how to disable all these services I ...
0
votes
1answer
146 views

Bash script installing within multiple directories [closed]

I am attempting to write a bash script that will install rbenv from beginning to end. I am on a Mac for interest sake. But there are some things that are not working mainly i am changing the ...
0
votes
1answer
473 views

Script with root permission [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on I am creating a script to change the brightness of my laptop. I discovered that I can do this using ...