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 (4)

0
votes
1answer
31 views

How do I kill a runing fortran code from inside a shell script that access the same code?

I have to use a FORTRAN code which has a "menu style" interface. I access the code typing a command on the terminal which opens the main menu. From that point and beyond I type a number and enter it ...
4
votes
1answer
43 views

“@” sign in startup commands

In my ~/.config/lxsession/LXDE/autostart file I have lines like: @lxpanel --profile LXDE @pcmanfm --desktop --profile LXDE Other lines (that I added using the Preferences/Default Applications for ...
1
vote
1answer
32 views

Floating point in CSH?

I have been trying to run this script, but it gives the error "badly formed number" due to the decimal 0.2224. If I replace it with any integer, the script works fine. #!/bin/csh -f set shift="-1 2 ...
0
votes
0answers
42 views

Comparing integers in bash doesn't work

Why this doesn't work: #!/bin/bash if (( 3 > 2 )) then echo "EXPECTED RESULT!" fi Output: test.sh: line 3: ((:  3 > 2 : syntax error: operand expected (error token is " 3 > 2 ") ...
1
vote
3answers
79 views

How can I create a command with arguments and a configuration file? [closed]

Directly to the point, I want to give the user the flexibility to pass arguments to a command in order to control how the commands should run, something like: pcap -d 30 -w 2 In other words: I ...
1
vote
1answer
78 views

what does if [[ -e $filename]] means

I have this legacy Linux shell script code that I am trying to understand. I would appreciate any explanation: if [[ -e $fileName]]; then what I am curious about what does double-bracket mean?
5
votes
2answers
120 views

Is there software which time- tracks window & application usage?

Is there a software which keeps time of my activities and gives a report? Based on focused window and window title. Report would just show time spent for specific window and its title like: ...
1
vote
1answer
48 views

Loop trough all folders recursively end execute make command when Makefile present

I really suck in bash scripting, so i'm hoping on your help guys. I need a script which will loop trough all folders, sub folders, sub sub folders, etc. inside folder /home/work and if there is ...
3
votes
0answers
38 views

How to find the last valid information possibly spread over several log files

I have a fleet of busses that send me a monitoring log file every morning regarding the status of the vehicle the previous day. The log updates various information every 5 minutes. Among the data ...
1
vote
2answers
85 views

Stop apt-get autoremove from removing old kernel?

I like managing kernels my self, and I can't figure how to stop apt-get autoremove from deleting older kernels.
0
votes
2answers
35 views

Shell Script Won't Run

Newbie. I am trying to install BeautifulSoup4. There is a shell script "convert-py3k" to run, to convert to Python 3 version. It has an executable permission but, neither double clicking nor, ...
11
votes
4answers
734 views

How to write a script which works with or without arguments?

I have a bash script which goes something like this: #!/bin/bash if [ $1 = "--test" ] || [ $1 = "-t" ]; then echo "Testing..." testing="y" else testing="n" echo "Not testing." fi ...
2
votes
1answer
65 views

How do I get my script to run BEFORE any shutdown sequence like unmounting my external drive

I have a back up script in ~/scripts/backup.sh and my upstart conf in ~/.config/upstart/shutdown.conf. description "my shutdown script" start on desktop-end task console log script exec ~/scripts/...
0
votes
0answers
15 views

Upstart 1.12.1 only running first exec

file /etc/init/karl-startup-sensei-init.conf: description "something" author "karl" start on runlevel [2345] script exec echo `date` /etc/init/karl-startup-sensei-init.conf - starting >> /...
0
votes
1answer
25 views

Running two scripts on profile login (bash & sudo bash)

I have two scripts which I would like to be run when I log into my profile. ~/.scripts/startup/user-sensei-raw-startup.sh: ids=$(xinput list | awk '/SteelSeries Sensei Raw Gaming Mouse .*pointer/ {...
0
votes
0answers
28 views

xfce create Launcher for .sh with parameters

Im trying to create a launcher but I never worked with a desktop environment before. The file is placed at /home/Teamspeak3/ts3server_startscript.sh and needs the parameter start to run. I've ...
0
votes
0answers
27 views

Custom script not working as expected in ubuntu [duplicate]

I wrote a java application, want to register it as a service, so wrote a bash script in /etc/init.d/. Here is the script: #!/bin/sh # # chkconfig: 345 50 83 # ### BEGIN INIT INFO # Short ...
0
votes
0answers
61 views

Crontab - export DISPLAY=:0.0 or .sh script won't run

I have written a basic script to familiarize myself with crontab that changes my wallpaper every minute with one random image from a set folder: #! /bin/bash PATH=/usr/local/sbin:/usr/local/bin:/...
1
vote
1answer
60 views

Scan from scanner and directly print to another printer (2 devices)

I have a Canon PIXMA MFP that can duplex scan a stack with its document feeder. I have a separate Brother Duplex Laserprinter. The Canon is over WiFi and can scan easily with the Simple Scan ...
1
vote
1answer
27 views

Does rng-tools run at startup?

I installed rng-tools and noticed that is has a script in /etc/init.d. Does that mean that it will run at boot? Or do I still have to run rngd -r /etc/random or /etc/init.d/rng-tools start?
2
votes
1answer
81 views

How to Integrate Dropbox in Thunar?

How can I integrate Dropbox into Thunar? I am using Xubuntu 14.04 with Xfce 4.12 installed via PPA, and thunar-dropbox-plugin has been broken. I have also heard that it is not working on Xubuntu 16.04....
0
votes
0answers
18 views

run script on a remote machine

I'd like to run my script on a remote machine. I have a bunch of scripts,so I'd like to use source command in main file. How I can do that? Is this possible or not? My main file script: source ./...
0
votes
0answers
140 views

Can't execute .sh file that works finely through the terminal in Xubuntu 16.04

My first attempt with scripts, is a shortcut to open a Jupyter Notebook on a specified folder from an file on the Desktop called ipython.sh. The content of ipython.sh is: #!/bin/bash cd ~ ...
1
vote
0answers
93 views

Launch python script fullscreen on startup (Ubuntu 14.04)

I have a python program that I would like to automatically run after logging in. This shouldn't be much of a problem, however, I would like the terminal to be in fullscreen mode while running the ...
0
votes
2answers
28 views

execute a file having some terminal commands [duplicate]

I want to create a file which contains some commands (suppose 4 commands) such that when I click on that file, the commands will executed in terminal. Is it possible ? I am using Ubuntu 14.04 LTS. ...
1
vote
1answer
20 views

How could one export from a sourced script only specific functions

I try to expose from a script only specific functions. For example, let's say I have the script hello_world.sh and it has 2 functions, hello and world: ## hello_world.sh - name of the file, not the ...
0
votes
0answers
49 views

Gammu runonreceive doesn't pass variable

i want to configure my Rapsberry as a SMS Ping Pong Player. So i installed gammu-smsd and configured the gammu-smsdrc as follows: # Configuration file for Gammu SMS Daemon # Gammu library ...
0
votes
1answer
32 views

bash storing array variables in rotation

My objective is store values in array , as below: arr[0]=apple arr[1]=banana arr[2]=orange arr[3]=grapes arr[4]=apple arr[5]=banana arr[6]=orange arr[7]=grapes arr[8]=apple arr[9]=banana I can ...
2
votes
3answers
112 views

How can I automatically try a specific resolution if I connect an (any) external monitor?

Is there any way to configure Ubuntu to set default "first-try" monitor resolution whenever a (or two) monitor plugged in. Regardless of what graphic cards or graphic driver that being used. For ...
1
vote
1answer
34 views

How to restart gnome shell but daemonise it from a script? [duplicate]

I have a couple of scripts to work around Gnome Shell's inability to work well automatically when swapping between FHD (1080p) and UHD (4k) screens. I set various things with gsettings, restart nemo, ...
6
votes
3answers
787 views

A script for copying random folders

I'd like to realize a little project I've always had in mind. I have a vast music library on my desktop and I'm looking for a way/script to select a random amount of folders (say, 25 albums) and, if ...
1
vote
0answers
45 views

notify-send not showing popup message

I have a script which executes on certain conditions, whenever I manually execute the script, the popup appears, however if i try to aumotate the script(i.e. run the script right after system is ...
0
votes
1answer
52 views

SSH fails in Crontab after reboot

I am regularly running a shell script through Crontab that uses SSH to connect to a server. If I run that script manually it runs through successfully. Within the same session Crontab will ...
0
votes
3answers
48 views

How to run a Python script not as '~$ python myscript.py' but as a single command '~$ myscript'? [duplicate]

I have a Python script which takes command line arguments. When I want to run the script I have to navigate to its directory and run: python myscript.py [arguments] How can I run it like: ...
1
vote
1answer
33 views

start script after resume as logged in user (not root)

I'm running owncloud client in Ubuntu and after a suspend/resume there's a bug in owncloud which makes it not be able to connect to the server. I wrote a little script which should restart owncloud, ...
0
votes
1answer
50 views

Script not running on resume/wakeup in Ubuntu

I have a script named 999_thaw_flash.sh in my /etc/pm/sleep.d The script follows like this :- export DISPLAY=:0 #!/bin/bash case "{$1}" in resume|thaw) lynx --dump link1 >> file1 lynx --...
0
votes
0answers
70 views

I have a problem with a loop in a script. How I can create a loop in a loop?

I'm doing a script for improving my scripting capacities, but I can't make a loop work, how I can fix it? Here's the script: As far as my knowledge go, the problem is in the below script: read op2; ...
0
votes
0answers
17 views

reboot bash script for Beaglebone stops without finishing

For the longest time I used the following script: #!/bin/bash echo 'start' && ssh -o 'StrictHostKeyChecking no' root@192.168.7.2 'reboot'&& echo 'end' which echos "start" and also ...
1
vote
2answers
17 views

How should I set enviroment variables at GNOME login - not shell?

Ubuntu 12.04, GNOME Classic I have a script that I execute from /etc/bash.bashrc. Whenever I open a terminal, it sets some environment variables needed for my applications to run. I execute them from ...
0
votes
0answers
11 views

Scripts for disabling and enabling proxys are not working [duplicate]

I have following scripts for enabling and disabling proxys, but looks like they are not working. Do you guys know what might the problem be? enableProxy.sh #!/bin/bash export http_proxy="http://...
0
votes
0answers
26 views

Why is xinetd so slow?

I'm using an aws ubuntu distro (small size) to receive webhooks from github. The basic setup is to use xinetd to kick off a small bash script to read the post data in from github. If it's a ...
0
votes
0answers
24 views

Is it possible to use variable for zenith with single quote

What I tried to do is to show files installed to ubuntu, using zenith. Files installed are depending on other thing. So the text content shows with zenith is set to be a variable. But with my ...
3
votes
2answers
56 views

How to write a script to toggle unitytweaktool setting (hotcorners)

Specifically, I want to toggle hotcorners on/off every time I start a steam game. But I have no knowledge of scripts of any kind. Any resources to learn this kind of stuff would be great. Please ...
0
votes
1answer
54 views

Create double click executable file

I would like to create a file, which could be saved in the Desktop or in another folder, which upon a user double click on it executes some commands, one of which should be as super user (sudo) and ...
0
votes
2answers
44 views

Bash scripting problem on echo -ing the current working directory

I have this code: #!/bin/bash #clear screen clear # Ask for name of directory to create echo "Please enter a directory name" echo "that you wish to create" read dir1 # create directory mkdir $...
0
votes
0answers
66 views

Copy/move a list of files to a directory while maintaining directory structure

I have Ubuntu 14.04 os installed in my system. Now I need to create a script for copying/moving a list of files and directories of a Magento module to another main parent folder along with ...
3
votes
1answer
62 views

Script to convert .wma to .mp3 command not found [duplicate]

I am using a script called conv-script that I found on AskUbuntu here. It looks like this #!/bin/sh readarray -t files < wma-files.txt for file in "${files[@]}"; do out=${file%.wma}.mp3 ...
1
vote
0answers
98 views

Not able to execute a url from python script running via Cron

I have a script web.py which I am trying to run on the aws EC2 Instance using cron. It basically has these line of codes: import webbrowser webbrowser.open('http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx') If ...
0
votes
1answer
24 views

Can (or should) a script perform a login?

I have a nightly process that SFTPs files from a Windows server to our Unbuntu server (12.04.5 LTS) using my username and login. A script is setup via cron (sudo crontab -e) runs later to copy those ...
0
votes
1answer
36 views

How to run a C++ program in python as a root? [closed]

I want to run a C++ program at boot with root privileges, I could not find how to do it. import subprocess def run_c_program(); subprocess.call("/home/pi..../example") When I run the ...