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)

3
votes
2answers
32 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
292 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
28 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
26 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
62 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
39 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
55 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
54 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
45 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
47 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
14 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
365 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
15 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
42 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
324 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
437 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
26 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
30 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 ...
11
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
52 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
233 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
55 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
35 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
80 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
23 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. ...
0
votes
0answers
17 views

Why Live Ubuntu terminal freezes at the end of disk cloning?

I had taken Ubuntu whole disk backup using dd command as: $ sudo dd if=/dev/sda* of=/dev/sdc* bs=512 conv=noerror,sync where /sda is computer harddisk and sdc is External Backup USB drive. Later I ...
0
votes
0answers
24 views

How to send email from script

I'm trying to write a script that will send an email with all the files from one folder attached, then move those files to another folder. I've done the latter bit with a bash script, but I've never ...
0
votes
2answers
78 views

Can I have a countdown window show the time until next suspend?

Occasionally I leave my computer unsuspended when I need to go somewhere but I am leaving it with people I absolutely trust and I will be back shortly so no real need to suspend (like if it's family ...
1
vote
2answers
70 views

vim.desktop - changes lost when terminal exits

I was thrilled to notice a GNOME launcher for vim in the vim-common package after I upgraded to Ubuntu 16.04, since it offers an alternative to gvim (a solid app, though not perfect for my workflow). ...
1
vote
2answers
86 views

Can I use the terminal to move images to specific dir's using the images 'tag'?

I have a huge folder of images that I've collected over the years that my students use for coursework. It started off with about twenty images so I didn't really bother with file names or any kind of ...
0
votes
0answers
20 views

The power supply of my external monitor broke, how can I switch on my internal screen?

Ubuntu version : 15.10 Laptop display : disabled External monitor Dell s2415h : enabled The power supply of my external screen is gone, so I can't see anything on my external monitor but the ...
2
votes
2answers
50 views

Create a script to move files that ignore errors

I can move files in the terminal easily enough. I have a whole mess of stuff submitted by students daily and it'd make my life a lot easier to have one thing I can run of an evening that'll move all ...
0
votes
0answers
18 views

Scripts (suddenly) not running from Nautilus

I wrote some scripts, set Nautilus to run executable text files without asking, set the files as executable and everything worked as advertised. I double-click my scripts, they open up in gnome-...
-1
votes
1answer
19 views

how to find a folder based on creation time

I would like to write a small script that: finds the creation date/time of a folder on a server that creates a backup folder every two days with the date as 2016 04 22 as folder name remove the ...
0
votes
3answers
36 views

How can I use a script to get the IP address from ifconfig if the size of the IP changes in size with each connection?

I'm currently working with this IFTUN="$(ifconfig tun)" IPADD=${IFTUN:106:13} echo $IPADD But if the size of the IP address changes this isn't going to work anymore. inet ...
1
vote
2answers
37 views

How to see if a specific process is running or not for 1 hour in shell

My process name is test. If I use ps -ef | grep test I see that process is running. Now I want to check this every 10 mins for one hour and print success if it's running successfully for one hour. ...
0
votes
0answers
37 views

pacemaker corosynce lsb resource script( Sybase Database ASE Server and Backup Server)

I'm trying to create a lsb resource with pcs on rhel7.2 The "sybase" script is about Sybase Database ASE Server and Backup Server Startup & Stop & Restart $ status script The script is all ...
0
votes
1answer
26 views

Concatenate two paths

I want concatenate following: current_dir=/home/akshay/UCS source_dir=/lib/python2.7/lib-dynload/ I want to produce something like this: /home/akshay/UCS/lib/python2.7/lib-dynload/ and then I ...
0
votes
0answers
47 views

how to write upstart script for a background service (db)

I am on ubuntu 14.04 server and I am trying to write script for my database. i added this file to /etc/init/neo.conf: description "neo4j upstart" start on startup stop on shutdown script echo $$ &...
2
votes
0answers
36 views

Facing errors with running shell scripts at startup and poweroff

I am using Ubuntu 14.04 LTS and I want to run 3 scripts at startup. They are named as follows: voe.sh startUp.sh and runDown.sh The script voe.sh is the main file which will in turn call the other 2 ...
-1
votes
1answer
32 views

Some programs print errors to stdout instead of stderr, and don't set $? when an error occurs. Why? [closed]

See title. I've seen this twice recently, with both udisks and pacmd, and they are 100 times harder to script because of it. Why do programmers do this? For example, I want to switch the audio output ...
0
votes
0answers
53 views

How to make self-extracting executable (.exe in Windows) [duplicate]

I have created a script (Just some batch files) and compiled them into a .exe for ease of access. I have already converted said Batch files into shell scripts, how would I turn them into a single ...
3
votes
4answers
167 views

Rename files to their parent folder

I want to rename file name with its parent folder name, adding the folder name before the current name. for example: Folder structure SOCH NC KT 633-ROYAL BLUE-MULTI | | 1.jpg | | 2.jpg | | 3.jpg ...
0
votes
3answers
53 views

string “if” statement comparing is string empty

I have problem checking if string is empty. I get first column of ls -l info and try to grep string searching for "x". If string is empty, I should countinue. But whenver string is empty or not, I ...
0
votes
2answers
66 views

Enter password only once for shell script

I have made a shell script to update & upgrade my existing packages all in one go. The script is: #!/bin/bash sudo apt-get update; sleep 10; sudo apt-get upgrade; sleep 10; sudo youtube-dl -U; ...