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
0answers
26 views

Edit /etc/environment via Command Line [duplicate]

I am using Ubuntu Server 14.04 and I would like to be able to edit the /etc/environment file via the command line to append the file with environment variables. This append operation is going inside ...
1
vote
1answer
39 views

Recursive Scan To Move All Files And Deleting Empty Directories

I am learning bash scripting and want to move all *.ort files to a new directory and delete the directory once the .ort file is moved. To Note: I do not need to keep same structure - I want to move ...
1
vote
1answer
24 views

Script Appends Extension Twice

I am running a quick bash script that will convert any .mov files to .mp4. This works great 99% of the time, but sometimes I hit a snare and I get an error of: the file /home/jgeoffrey/Documents/...
0
votes
0answers
18 views

The upstart at least a shell script

What 's wrong with my upstart configuration files? I want VAL = 1 as a result of result.txt. /etc/init/test.conf description "test" start on startup script if [ $(cat /test.txt) == "...
2
votes
2answers
393 views

python hashlib fails to install pip

I have a script that depends on hashlib, but when I try sudo pip install hashlib I get this: $ sudo pip install hashlib Collecting hashlib Downloading hashlib-20081119.zip (42kB) 100% |█████████...
9
votes
2answers
315 views

Is there a “don't disturb” option to temporarily hide notifications, like on macbooks?

Does there exist "Don't disturb mode" as is does for OSX device, where you can decided when notification can bother you, or not.. I just installed chrome, and I usually get spammed by group texts ...
1
vote
0answers
71 views

Scripting dconf changes

I've written a simple script for our Ubuntu machines at college which sets some dconf overrides to set the theme, background etc. However I cannot seem to get it to correctly set the login screen ...
0
votes
1answer
28 views

My bash script doesn't work when triggered by crontab, but works when i trigger it manually?

this is the cron entry */1 * * * * ./home/usr/automation/check_rejected_files.sh > /home/usr/automation/cronout it produce the file but nothing else happen, i added a date log in the beginning ...
0
votes
0answers
46 views

Shutdown multiple minecraft servers with a script

I have multiple minecraft servers running on an ubuntu server. All of them are running in a screen belonging to their according user. I currently have a server running in a screen owned by user 'limbo'...
0
votes
1answer
21 views

how to get 2 epoch time value in varibale

If I am running this command from command prompt its fine but how to put it in shell script ? Basically this command is subtracting 2 epoch time but I need their output value in a variable. date -d @$...
2
votes
1answer
377 views

Bash 12 - 08 Value too great for base (error token “08”)

So, I'm trying to calculate 12-08 (not 12-8) and get the following error: let: 08: value too great for base (error token is "08") Here's the sample code: first=12 second=08 if [[ ($first > $...
2
votes
1answer
49 views

pyosd works with interpreter , but not with a script

I am working on a script that would display arbitrary system information on screen. For that purpose I've been trying to use pyosd module. Consider the following 3 lines: import pyosd p = pyosd.osd()...
-1
votes
1answer
109 views

How can I open multiple html files with gedit from a script?

I have a list of HTML files I use for writing. I would like to script to open them for editing. HTML files are associated with Firefox as the Default Application on my system. New to Linux and ...
0
votes
2answers
36 views

Script to enable “source” downloads in a deterministic manner

I wrote a couple of scripts to help users pull their current kernel source package, apply some patches of mine, and build it as a .deb package with make-kpkg. One of the few steps that requires manual ...
-1
votes
1answer
55 views

Help with “grep” command in terminal [closed]

I ran a command on a terminal in Ubuntu: $ grep "Director" file.lst And the output of that command was 1006|Pankaj | Director|sales|03/09/38|6700 I want know the full description of the output ...
2
votes
2answers
93 views

Why does sudo require a password the second time in a bash script every time? [duplicate]

I have a simple very tiny web app, and wanted to make my life a bit easier by having a very simplistic deployment script, that does the following: Pull updates from git Run composer Change owner of ...
0
votes
1answer
32 views

Script to send Email if Log grows past 90M

I have the Below Script to check the size of my Log file. Should it grow to beyond 84M to should be renamed with the current date and a a new one is automatically generated by my APP. However it ...
-3
votes
1answer
42 views

Scripting a script that tests a shell [closed]

I have a custom shell and want to test its arithmetic function. I wrote a script to test it and it performs the arithmetic but it is also trying to execute the result as a program. printf "******...
2
votes
1answer
60 views

Ubuntu 14.04 Start Terminal on Active Screen

I'm currently working off Ubuntu 14.04 on two separate screens. When I use the keyboard shortcut to start the terminal, Ctrl+Alt+T, the terminal is currently defaulted to open on the screen on the ...
0
votes
3answers
151 views

How can I run a shell script from bashrc file?

What I basically want to achieve is to type in a custom command in the terminal and a specific shell script should run each time. I could achieve the above requirement with folders,by modifying the ...
3
votes
2answers
35 views

How to read symbol separated strings from a variable, convert to numbers, and perform arithmetic?

In a bash script, I wish to pass in a string which is contained in a variable, and contains up to 3 substrings separated by the '+' symbol. Each substring will have a specific numeric value, sort of ...
2
votes
3answers
295 views

Cyclic script execution

How to make the cyclic execution of the script? At the end of the script i need to run it again. Cron is not suitable, because i need to run the script immediately after the previous
1
vote
1answer
31 views

Hot Corners Musical Sequence Command Script

I am writing a script which uses hot corners to play specific musical notes when hovering in corners, and depending on the musical sequence to execute a specific command. The script is called with ...
0
votes
0answers
36 views

Multiple keystrokes in 1 macro script with xmacro

Okay so my situation is that i am trying to make a macro for a video game i know that macros work inside the windows emulator because i have had 1 batten things work in my testing i am using this ...
0
votes
1answer
29 views

Bash script syntax

I want to create a .sh script which will execute a python file called match_scraper.py, update a psql db as shown, call a scrapy spider to execute. When I create the .sh script how do I call ...
3
votes
2answers
68 views

Shell script password with special chars

I've build a shell mysql backup script which works very well. It only has problems with passwords with special chars like this: xgT{uic[Is?uJ+. Here is the important part of the script: #!/bin/sh ...
0
votes
1answer
44 views

How to connect via ssh and use gcc on target?

I would like to do two things automatically within a bash script: Connect via ssh to my target. Execute gcc. My script looks like this: ( echo "cd myfolder" echo "gcc -o mybin ...
1
vote
1answer
58 views

Bash script cannot run with keyboard shortcut

I have this script in my /home/username/ And I can run it via terminal with the following code ./script.sh or sh script.sh it works (it has executable permissions) but I cannot assign it to a ...
1
vote
2answers
55 views

How to check for executable files in a given directory and its sub-directories?

I understand that it is a bad practice to keep files owned by oneself in one's home area which are executable, so I am in need of a script/tool which checks recursively through a given directory (in ...
-1
votes
1answer
51 views

start screen programm with crontab @reboot

I try to start a start.sh at reboot with crontab. But nothing happens afer a reboot, and the log is without an error. Does someone know what i've done wrong? For testing i gave the start.sh and Mod....
0
votes
2answers
50 views

Can we install a package through a shell script?

I'm trying to write a shell script so that when I reinstall my Ubuntu again. I could just run script and retain all the packages. And I'm planning to pass password in form of argument. My question ...
0
votes
0answers
16 views

Unwanted Delay in execution of rc.local

I have an few commands in /etc/rc.local to set the clock on a Raspberry Pi (running Ubuntu 14.04) from an external rtc. I would like these to be executed during start up, before I log in to the ...
0
votes
1answer
620 views

after upgrade to 16.04 LTS rc.local not executing command

On previous installed version kubuntu 15.xx i added a line into /etc/rc.local > /home/diet/scripts/my-auto-mount-script which obviously referred to a script that if on home wifi network drives should ...
0
votes
0answers
16 views

Service script is not working

I'm able Start Service With init.d script, however doing service start does not work For eg /etc/init.d/haskal start The service is starting fine and service test start Service not running Ubuntu 12....
-1
votes
1answer
43 views

Executing shell script

I have a script: echo "start" cd ~/GoogleDrive/ drive push path-to-file/ echo "done" which uploads path-to file to my Google Drive account. I can run this script without any problem by sh ...
3
votes
2answers
325 views

Command line IF not working as expected

I'm relatively new to the terminal programming. I'm trying to run an IF condition within a FOR loop. (The command is to be run by a cronjob) for i in {1..5}; do echo $i; if [ $i>3 ]; then echo $i; ...
1
vote
1answer
69 views

downloads file in parallel [duplicate]

I have list of url(near about 50k) of images in text file which I want to download. Is there anyway I can download it in async way using wget command or any other way, by reading it from text file.
1
vote
1answer
26 views

Script for Dual boot

I am running file server in ubuntu server with dual boot with windows 7 now i want SCRIPT that can restart the server at the midnight and start to windows 7 and i have put some customise script in my ...
0
votes
1answer
941 views

Syntax error near unexpected token `newline' while installing Predictionio

I'm new to Prediction.io and when I try to install it following the instruction at this page I get the following error: bash: -c: line 0: syntax error near unexpected token `newline' bash: -c: line ...
0
votes
0answers
20 views

Multiple commands to rtorrent

I am trying to modify the .rtorrent.rc file because I need to run, if possible, 3 commands after a torrent is completed. The task would be : Get the dirname and print it to a file Move the files ...
1
vote
1answer
28 views

How can I run a script when click on soft-link to directory on other partition?

I have created a link to directory on windows partition on Desktop in Ubuntu 14.04. Because this partition will not be automatically mounted at startup the link is marked broken each time I power on ...
0
votes
2answers
39 views

How to start Crontab before login?

Basically I have a script (.sh) that syncs a local folder with an FTP one (using cron to run this). This script needs to be ACTIVE AT ALL TIMES (business use :D) and the only thing I cant control is ...
12
votes
5answers
2k views

.sh specifying extension?

Why is it some systems will run a .sh file just by specifying the file name without extension and others require name plus extension? In my case I'm trying to write a series of commands following ...
0
votes
2answers
51 views

How to write a recuring bash script

I created a program that requires a sequence of command line instructions to scrape new information and update the databases. Is there a way to automate this process so I don't have to type all this ...
1
vote
2answers
60 views

Execute a command stored into a $variable

I made a script where I wrote: COMMAND="/usr/bin/exiftool $PATH_NAME" .... code .... $COMMAND The variable $PATH_NAME is assigned dynamically inside a while loop. The command works fine until it ...
0
votes
0answers
253 views

java not found when running Ubuntu 16.04 desktop snappy app

When running this script from within a Ubuntu 16.04 desktop snappy application I get the message /usr/bin/java not found. Also, the application does not create the files and folders in my Documents ...
1
vote
2answers
61 views

Bash script help, check permission 755 on all files in a folder

I'm attempting to create a bash script where I check if all the files of a specific folder (/tmp) have the permission 755. I also need it to delete all the files that don't have permission value 755. ...
2
votes
1answer
36 views

How to run a parameter as an alias in a shell script?

I have an alias alias ll='ls -lF'; I created a bash script temp.sh: #!/bin/bash # Allow aliases to work in bash NON-interactive mode! shopt -s expand_aliases # .. and load them source ~/....
3
votes
1answer
109 views

Auto dimming laptop keyboard backlit when idle

On Windows 10, my laptop's keyboard backlit automatically turned off after a minute or so of inactivity. As soon as any activity occurred, they turned back on. On ubuntu, if I run the following echo ...
0
votes
1answer
24 views

Protect root-owned script against tampering and run unattended w/ sudoers' NOPASSWD

Using /etc/sudoers I gave a non-root user (anyuser below) permission to sudo-execute a root-owned script (test-script below) with the NOPASSWD: tag set. The script's permission octal value is 0550. ...