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)

0
votes
1answer
20 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 if statement is executed (no loops in the current script). That is how many times the script got executed. eg: ...
0
votes
1answer
21 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
19 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
46 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
38 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
12 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
21 views

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

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
25 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
49 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
22 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
50 views

help with my script “path of shell” [on hold]

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
20 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
27 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
63 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
34 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
54 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 ...
0
votes
0answers
17 views

How to avoid going to next line in perl script..? [closed]

In the following perl script, results give an un-necessary next-line operation. How to avoid this? $date = date >> /home/user/Desktop/PERL/TEST_FILES/hdd_ram_logs.txt; @matches ...
-1
votes
0answers
21 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
41 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
78 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
47 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
72 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
11 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
61 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
303 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
29 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
436 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
199 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
18 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
69 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
23 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
155 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
168 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 ...
1
vote
1answer
55 views

script sh syntax error [closed]

I have this script: #!/bin/bash IP='192.168.1.1' fping -c1 -t300 $IP 2>/dev/null 1>/dev/null if [ "$?" = 0 ] then echo "Host found" else echo "Host not found" fi When I try to run it, ...
1
vote
1answer
37 views

cannot change directory with script [duplicate]

I tried the following script to give myself convenience in changing directories to different hard disk partitions. But after its execution, the default location does not change, but if I use command ...
1
vote
1answer
32 views

Why is my script file executable on a virtual machine?

I have ubuntu installed on a virtual machine in Windows. There when I run a script I just type sudo ./blabla.sh in the terminal to run it. Then I installed ubuntu from same iso file directly on a ...
3
votes
1answer
26 views

How to disable touchpad while running full screen applications / games?

Laptop support in Ubuntu is rather disappointing. It's like Ubuntu and Kubuntu are two different worlds. Is there a script to disable touchpad while running full screen applications? I tried to write ...
0
votes
0answers
14 views

Help writing an Upstart script

On my Ubuntu 14.04.2 server there's an installation of ownCloud with its News app. Now, for some reason or another, a couple of days ago the app stopped pulling new articles via owncloud cron.php. ...
0
votes
0answers
33 views

Xinput command in autorun script doesn't execute

I use two monitors 15 inch and 19 inch. With the 15 inch I also use a touchscreen. I have to map touch events to 15 inch monitor with this command: xinput map-to-output 11 VGA1 11 stands for id ...
1
vote
2answers
120 views

Shell script does not run when I double click

I have made a shell script (test.sh) on my Lubuntu (15.04) desktop. Permissions are: Only owner (View content + Change content + Execute). When I double click test.sh, I choose "Execute in Terminal". ...
1
vote
2answers
53 views

error while cron scheduling a sh script

This is my shell script which i want to schedule using cron job. parser.sh #!/bin/bash source .profile workon venv cd /home/ashish/deployments/myproject export ...
2
votes
4answers
55 views

Output a list of all file names in a directory with the last 5 characters removed from each

I have a directory that contains files with names, 00004.time, 00010.time, ... There is not pattern except the format, <5 decimal digits>.time I would like to output to a file, just the ...
0
votes
0answers
29 views

How to run a compiled cpp file after booting up the system [duplicate]

I am using an arm v7 soc system which runs ubuntu very well. I can run my compiled cpp file (compiled with g++) perfectly from terminal by ./myproject. However i want code to start automatically ...
1
vote
2answers
22 views

Need my random effects to show the full line

I am working on a script for random predictions and unfortunately instead of the script taking the full lines from the two random lists (Things and Effects) it prints a random word from each. Can ...