Script is series of instructions written in plain text file. The script interpreter (i.e. shell, Python, Ruby, etc.) can read this file and act on the instructions as if they were typed at the command prompt. The interpreter also provides a variety of useful programming features to make your scripts ...

learn more… | top users | synonyms (1)

1
vote
2answers
107 views

Script to spread each file to its associated directory

The scenario is: I have a directory with thousands of pictures in the format YYYYMMDDXXX YYYY: stands for year MM: stands for month DD: stands for day XXX: stands for an ID of the picture, it ranges ...
0
votes
0answers
30 views

shell script in /etc/profile.d not running at startup [duplicate]

I have a shell script at /etc/profile.d/pg_local.sh. It contains the following contents: export PATH="$PATH:/usr/local/pgsql/bin" Its supposed to load that path in the user accounts' $PATH when the ...
0
votes
1answer
38 views

how to create my own command on shell Scripting [on hold]

can you tell me how to create a new commnand on shell Scripting? thank you
0
votes
1answer
18 views

discover if other users are executing the watch command on the machine in which MyOwnCommand is beeing executed

I want to know if there are other users that are running watch on the same machine in which command X is being executed. How can I do that?
0
votes
1answer
28 views

no echo in bash shell script loop

In this script, the second echo statement doesn't do anything. #!/bin/bash echo "Start folder create..." find . -name "*.zip" | while read filename; do foldername="${filename%.*}"; mkdir -p ...
2
votes
1answer
85 views

Shell script with select command to show a list of files

I've written the attached bstls.sh shell script which uses the command select to choose the subfolder or file in a folder passed as argument on which execute the ls command. #! /bin/bash #Personal ...
0
votes
1answer
12 views

OpenNMS installation fails with error, Apt-Get broken

I was installing OpenNMS and during the install it fails with following error Preparing to unpack .../slpd_1.2.1-9_amd64.deb ... Stopping OpenSLP server: slpd. Unpacking slpd (1.2.1-9) over (1.2.1-9) ...
0
votes
0answers
44 views

How to add and pass system password as a variable in a script

I have a script which asks for system/login password and pass that password to further processing. This is the gist of programm by which I am executing my script. read -s -p "Password: " password1 ...
4
votes
1answer
69 views

How to execute a sudo script with double click

I have this script to shutdown my system after 30 seconds. I want to run this script by double clicking it (that option I changed in nautilus). This is the content of my script #!/bin/bash shutdown ...
2
votes
0answers
22 views

error insserv with script

I try to install Unbound with the following website: http://www.unix-tutorials.com/go.php?id=3681 I copied the script : #!/bin/sh # # unbound This shell script takes care of starting and ...
0
votes
1answer
21 views

scripts in if-up.d not executed when ppp connection is created

I have a simple script "test" in /etc/network/if-up.d directory. The script contains below commands. It creates a empty text file, whenever an interfaces changes state from down to up. #!/bin/bash ...
0
votes
1answer
37 views

error in running bash script as root

I have a simple shutdown script which i want to run as root shutdown -h +30; echo "succesfull"; I have followed these answer1,2 to make my script root. first I run this command sudo chown ...
0
votes
1answer
30 views

How to maintain a counter across multiple executions of a script?

I have a script with a conditional statement and I want to find out how many times the then clause is executed, across multiple runs of the same script. eg: if [condition] then Some code; ...
0
votes
1answer
23 views

How to schedule a script to be run as soon as the system is booted?

My laptop's touchpad doesn't work unless I enter the following commands in the terminal: sudo modprobe -r psmouse sudo modprobe psmouse proto=imps I could do this everytime I log in, but I want to ...
1
vote
2answers
21 views

Calling Values from a .properties file?

Right now I have a simple script I want to now call a .properties file and then print the results of that file, this is what I have so far #Specific Set Variables SpecficStatus="Pass" #SetVariable ...
2
votes
2answers
59 views

How to monitor the status of shutdown sequence

This is the script I made to lock and shutdown my system after 30 minutes. #!/bin/bash # Read Password read -s -p "Password: " password echo # shutdown and screensaver Command echo "$password" | sudo ...
0
votes
1answer
44 views

How to change display's position from command line?

How can I use the command prompt to do get the setup shown below? Edit: I need the secondary display to be located to the left and half-way to the top of the primary display, as shown above. The ...
0
votes
0answers
13 views

Gui/Script to set up Wifi at login?

Wondering if anyone has tried setting something like this up before. I'm planning on shipping a product that runs ubuntu, and it will strictly need to be wifi only. I am wondering if there is a ...
-2
votes
0answers
24 views

I Need execute a awk sentence on windows server [closed]

I Need execute a awk sentence on Windows Server, this sentence, read a file.txt, field takes column 4, and prints, I need run this sentence. thanks. Sentence:awk '/"Box11"/ { print $0 }' test.txt|awk ...
0
votes
1answer
28 views

How do I find out why I get anytime the same error message from an original Ubuntu script?

Swap2Ram.sh always produces its error message, even when I have enough ram left. Any ideas? #!/bin/sh mem=$(free | awk '/Mem:/ {print $4}') swap=$(free | awk '/Swap:/ {print $3}') if [ $mem -lt ...
1
vote
0answers
15 views

Screen in crontab

I'm trying to run 9 screens windows by crontab, and then, run some codes (basically the same for all of them), but they don't work. The code runs all of 9 screens, but run code only on the first. Aah, ...
3
votes
2answers
55 views

How to execute a shutdown with timer and screensaver command in a script

I made this script when executed will shutdown my system (after some time) and should enable a screensaver. #!/bin/bash sudo shutdown -h +30 gnome-screensaver-command -a There are mainly two ...
0
votes
0answers
13 views

Enable Vino Script Help

I have been trying to add and enable Vino to our districts Ubuntu laptops but have come up with some issues that I can seems to find a solution to and i was wondering if you might be able to assist. ...
-1
votes
2answers
24 views

Startup Command

i would like to run this command after my network has been established when i boot up my ubuntu. the command in the terminal is : "mavproxy.py --master=/dev/ttyACM0 --baudrate=57600 --out=myipaddress ...
-1
votes
1answer
51 views

help with my script “path of shell” [closed]

I usually php but also use bash to automate tasks on my server. I am trying to test this bash script but I'm not sure what "path of your shell" means. If anyone could help me with what i am meant to ...
0
votes
1answer
21 views

Execute scripts and Java programs from apache/PHP

I'm trying to allow apache and PHP to execute a script I have written that is located in /usr/local/lib the script in question is called "pathy" has been added to the path in my .profile, and I can ...
1
vote
4answers
28 views

What other ways to install ubuntu without using a flashdrive?

Curious about the other methods out there to install the operating system, Ubuntu. Thanks.
0
votes
1answer
20 views

Does a user creating text file need to be in a specific place?

I've got several scripts which wont work for me but work for others. Their purpose is to add users to the system, and then assign them to groups. I wrote it as a nano bash file; does it need to be ...
2
votes
1answer
65 views

How to make a batch file add users to groups?

I need help with a GCSE project, I'm stuck on the last question. It asks for a bash script to create users, and then assign them to groups. I've already made the script add new users, but I'm unsure ...
1
vote
2answers
36 views

Creating a terminal from a shell script in Ubuntu

What is the name of the executable for the Ubuntu Terminal program? I want to launch a terminal from within another terminal. For example inside an XTerm I can write: xterm& How do you do ...
2
votes
1answer
67 views

Stacking multiple for in commands

I'm operating on large amounts of data, and have a protocol involving several scripts. I launch it separately for each input file, simply swapping filename in text file containing the command. I would ...
0
votes
0answers
38 views

Copy standard output to file

Script 1 uses echo (and other commands) to standard output. Script 1 also runs other scripts, which also use echo (and other commands) to standard output. Script 1 is called by a scheduler that ...
-1
votes
0answers
22 views

How to display the 'percentage free' RAM usage using Perl Script? [duplicate]

I need to make a perl script which will display the percentage free RAM usage and the value should be able to be piped to another command. Appending into a text file should also be possible within the ...
0
votes
1answer
46 views

How to create a perl script which checks the system stats(CPU,RAM,HDD) and sends an alert mail? [closed]

The script is for adding to the cron tab. The flow of the shell script should be like this. 1. Checks the CPU state. 2. Checks the RAM usage. 3. Checks the HDD usage. 4.Sends an alert mail to ...
2
votes
2answers
81 views

How can I find windows of a specific application and place them into a grid?

I'm trying to write a script to identify all open chrome windows and move them into a grid layout on a large screen I'm not sure how to find out what the best resolutions would be so I was going to ...
2
votes
1answer
48 views

Using awk command in perl script [closed]

Can somebody suggest how to use piping of commands in a perl script? Specifically commands that involve calling awk? I'm trying to create a perl script that will read disk usage using df -H and ...
3
votes
1answer
27 views

Replacing string in a file

I wrote the following command: rpl -x'.txt' '0 ' '-1 ' /home/administrator/temp/myText.txt However I get an error message: Usage: rpl [options] old_string new_string target_file(s) rpl: error: no ...
4
votes
3answers
78 views

How I can monitor new files in a directory and move/rename them into another directory?

A program generates output textfiles, named output.txt, after every 15th iteration of a certain process. Doing so, it overwrites the last output.txt. I want to keep the files however, and I can't ...
0
votes
0answers
15 views

How do I remove a MATE panel applet from the terminal?

I want to be able to script a setup of a MATE desktop environment. I want to be able to add and remove applets without the GUI. Specifically, I'd like to be able to remove the workspace switcher.
4
votes
2answers
62 views

Why my bash-script doesn't work with cron?

I created a bash script to automatically update my Ubuntu Server. Here is the script: #!/bin/bash apt-get update apt-get upgrade echo "Update am $(date "+%d. %m. %y|%H:%M:%S) >> ...
4
votes
2answers
309 views

How to get a basic script to run on startup

I've created a basic script for me to input into Terminal every time I restart my computer so it'll update the repositories, upgrade the apps, and then fix my external monitor resolution. It looks ...
0
votes
1answer
30 views

How to execute an script as daemon with nohup?

Supose I have a script "script1.sh" and I want to execute it as a daemon with nohup and &, and make it be "waiting" for a signal. How should I do that?
12
votes
1answer
442 views

How to get the PID of my script?

If I have the script "script1.sh" and I want to make it print its own PID as a first step. How can I do this in bash?
3
votes
2answers
200 views

How to execute all scripts in a path?

Suppose I have a script that receives a path as a parameter. How could I execute all the scripts located in that path?
0
votes
0answers
19 views

Minecraft script wont run

In /etc/rc.local I have the following sh /path/to/file/myscrip.sh & #Go here Run this script. in the background I followed that path to confirm that it's pointing the right place on my ...
0
votes
3answers
28 views

Auto opening generated pdf file [closed]

My application generates pdf file and writes out to some folder. Is there any setup to automatically open it when its generated?
0
votes
2answers
70 views

Shell script I made is ridiculously verbose, and also is probably inefficient. Help!

I am new to Ubuntu, and so far have done several things I am quite proud of: Made an apache webserver with my own html (before a week ago I had never touched it) Made a stratum mining server +titcoin ...
1
vote
1answer
25 views

Trying to access debian/scripts and debian/rules

I am trying to rebuild the kernel because I want to change jiffies to 1ms. I'm following a turorial and it is stated that I shall do chmod a+x debian/scripts/* but I can not find the debian folder ...
1
vote
1answer
158 views

Run multiple line as a single line command bash

Is there any way to run multiple line as a single line command in bash script. This is my multiple line bash script id=15; if [ $id -ge 30 ] then echo Successful echo $id else echo fail echo $id fi ...
2
votes
3answers
173 views

Creating a folder based on a portion of a file name

I have several files named such: KILN_SDUS51_N0SILN_201203020003 KILN_SDUS51_N0QILN_201203020003 KILN_SDUS51_N0RILN_201203020003 I need to file all of them into folders based on the three ...