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)

2
votes
1answer
87 views

Bash script, arithmetic with floating point variables / strings that represent them

I'm trying to create a simple script that takes an average load percentage of the CPU each minute. I'm doing this by using the sar command from the sysstat package. Here is my current code: ...
0
votes
0answers
28 views

How to execute script as root during login of specific user?

In my specific case I need to log out user using sudo pkill -KILL -u <username> command and I tried by adding it to .profile and .bash_login but it doesn't seems to work and I couldn't find a ...
2
votes
1answer
31 views

Execute a shell script only for LiveCD session [on hold]

I want to execute a shell script on startup but only for LiveCD session not for harddisk installation. Which directory should I put my shell script? For example Ubuntu somehow detecting LiveCD ...
1
vote
1answer
44 views

How do i write a terminal script to setup ubuntu for me instead of spending days every time?

From what I understand I can make a text file with all commands same as I would type in terminal, make it executable and run it. Would running sudo mysetup.sh or mysetup.txt be OK so not typing PW ...
3
votes
1answer
48 views

How can I run a script when the power supply is plugged-in or -out?

For some reason, my laptop's screen brightness does not update when I plug-in or plug-out the power supply. I've looked at quite a few solutions for that problem, but none of them seemed to work well. ...
2
votes
1answer
20 views

Hadoop: Not able to find the start-dfs.sh start-mapred.sh scripts

I have installed Hadoop by following this tutorial. I installed it using ppa. When I reached step 12 : Starting Hadoop Cluster. I got stuck. When I do cd ~/tasdik/hadoop/bin/ It says no such ...
0
votes
1answer
34 views

Script wont print my echo statement (Also need to suppress the warning)

I am trying to write a very simple shell script in Linux. The Scenario I am trying to achieve is: Creating an user account and giving it a password internally (No interaction with user allowed for ...
3
votes
2answers
70 views

How to stock all files with the same suffix into a table?

i'm making a little shell script and i want to stock all files with same suffix in a table. i want something like that : path=/home/user/Documents suffix="_suffix.txt" and then a function that ...
1
vote
0answers
29 views

Running Python script in Abaqus in Ubuntu

I am running a python script through the scripting interface in Abaqus. It's a basic script that writes a value from each element from the abaqus simulation into a a text file. The text file is then ...
1
vote
1answer
25 views

bash script errors in ubuntu 14.04

I wrote a script whilst on ubuntu 12.04.5 which ran through fine however after upgrading to 14.04.2 to fix another issue i am now having issues with the script. It is halting at the first set of ...
0
votes
1answer
32 views

Problem with sudo via ssh

I'm using the following script to execute a update script on a certain number of servers in my network. Here is the part, which I think that is relevant. ### Actual Work ### if [[ $manual == 1 ]]; ...
0
votes
0answers
17 views

Pngquant returns error in Crontab [duplicate]

I have created a small script to compress all the images using pngquant in Ubuntu 14.04. The script is as follows: #!/bin/bash find /home/ghosthut/wp-content/uploads -mtime -2 -iname '*.png' -print0 ...
3
votes
2answers
896 views

What is the difference in running script with ./

What is the difference between running the script by calling directly its name and calling the script by adding a with prefix of './' . I can't find any difference in run time.
1
vote
2answers
71 views

Wait for PID - shown in ps

I am using the command below in a script to wait for a PID and then do something when that process finishes: while ps -p [pid] > /dev/null; do sleep 1; done; [cmd] where [pid] is the PID of the ...
0
votes
1answer
20 views

Cross fading several audio files using sox

I'm trying to cross-fade several audio files together with a 3 second cross-fade and join them together in to one file with sox. I can join several files together by the command below but not sure ...
0
votes
1answer
28 views

bulk image download from piwigo based web gallery

I'd wish to download original sized images from this website, built upon piwigo CM http://mermaid.pink/ Single image download is allowed, but that would take ages Could you suggest me a software, ...
0
votes
0answers
31 views

Join Ubuntu to Windows domain “automatically” not by the user!

I'm working on a project related to image cloning using a FOG solution (to clone an image of Ubuntu 12.04 to target machine using FOG server) We also have an active directory (Windows Server 2008) ...
2
votes
0answers
32 views

How to prevent pdf script code from executing?

Is there a setting inside Ubuntu Default PDF viewer (evince) or Okular to disable embedded script execution in PDF files ? It is a really important setting, that adds an extra security measure ...
0
votes
0answers
22 views

How to take a picture with the isight camera on mac using terminal

I have been trying to take a picture with a small script but I have no idea. All I want it to do is take a picture then show it without opening apps like photo booth. Ps I don't have sudo permission ...
1
vote
1answer
52 views

Bash script to remove item from Nginx cache

I have Nginx running in Ubuntu. I'm trying to write a script that deletes an item from the Nginx cache. Script: clear_single_cache_object.sh #!/bin/bash echo "Deleting: " $1 grep -lr $1 ...
0
votes
0answers
17 views

nfdump schedule with cron

Hi I tried to generate nfdump file with crontab, but whatever the reason it dosent work my script #!/bin/bash nfdump -mR /home/user/test -zw /data/fnf1.dump this script itself works and all other ...
1
vote
2answers
33 views

Undo the “sudo” within a script [duplicate]

Is there any way to undo the sudo within the script? like.. sudo ./script.sh commands 1,2,3,4,5 with sudo rights commands 6,7,8,9 without sudo rights
1
vote
3answers
141 views

How to log access to a specific folder and changes in its contents?

I need to track folder access time, and want to know what changes are made to it. How do I trigger those events? Is there a way to run a specific .sh file when the folder is opened?
0
votes
1answer
11 views

execute script on SSH exit

is it possible to execute an shell script when i'm exiting a SSH session? I want to execute script to disable a service when exiting
0
votes
0answers
18 views

Make shell script default to run file extension

I'm trying to make the default application for .asm file extension to be a shell script that I made. Basically I have a .sh script that runs MIPS Mars and I want to make it the default application to ...
0
votes
1answer
30 views

Sourcing a script from another script fails

I have a script in a file - install.sh - with this content: #!/bin/bash wget https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.sh sh kvminstall.sh source ~/.kre/kvm/kvm.sh Everything ...
0
votes
2answers
46 views

Custom Daily and Weekly Cron Jobs Not Running

I created a script to back up my databases and my websites. It runs fine if I run it straight up but it's not running at all as a cron job. I created a symbolic link to the script: lrwxrwxrwx 1 root ...
9
votes
2answers
117 views

Run only parts of a script as sudo, entering password only once

I am writing a script (actually a combination of scripts and makefile) that installs external dependencies: some apt-get commands, some git cloning, building, installing, adding users to groups, ... ...
0
votes
2answers
34 views

.sh command not working in a desktop launcher

I'm using a desktop launcher to run a.sh script. In a.sh I'm calling another script b.sh using another user using this command sudo -u userB /home/userA/Documents/b.sh. But for some reason it's ...
0
votes
0answers
26 views

Running cron scripts with php and node

I've gone through many posts for cron jobs, but still was unable to run it on my Ubuntu 14.04 environment. I have a file test.sh in /tmp/test/. The test.sh contains several other scripts in PHP and ...
0
votes
1answer
77 views

How to add custom applications/scripts in startup applications in 14.10?

I'm trying to run a script automatically on bootup but am unable to do so because my Ubuntu Gnome 14.10 doesn't have a Startup Applications manager I can't add any custom scripts through running ...
1
vote
1answer
23 views

Awk variable passing question

This is the code I wrote to resolve DNSs and output to a file. Is there a way to forgo the while loop entirely and just write in awk? It works perfectly but it seems very cumbersome and inefficient, ...
1
vote
0answers
26 views

Ubuntu Server 14.04 - won't run bash script file from desktop [duplicate]

I know there are tons of this question on here already but none of them seem to have solved my issue. I've done a clean install of 14.04 Server and install Unity (I know, boss asked for it so he can ...
-3
votes
0answers
24 views

how i can show the proccess running in ubuntu without using ps and top command?

I want to write a script which show output as PS command give. That means without using PS and top command I want to display running process on terminal. please help me. Thanks in advance
2
votes
0answers
29 views

How to correctly deploy/install scripts?

I've developed several utility scripts that solve specific problems of my team's day-to-day work. Until now what I have done to deploy the script in my co-workers' laptops is as follows: Every ...
0
votes
2answers
36 views

Whitespace Problems With Script and Variables

I'm trying to beat my head against the syntax of this. I'm getting problems with whitespaces and I can't see if there's a better way to do this. vardir=/home/user cd $vardir for i in $(ls "$vardir") ...
0
votes
0answers
31 views

Adding a file/directory to a specific location (on the Desktop) [duplicate]

I use Ubuntu 14.04.(Unity Desktop Environment) I like to use a specific part of my desktop(the screen) to store files related to my current work, and certain other spaces to store images and others. ...
0
votes
1answer
54 views

Reorganize photos from an existing folder structure into a new structure

This question might have been asked before, but I am not sure I use the right keywords to find it. I have a directory of photo's, that were (re-) organized before, into a directory structure: ...
0
votes
1answer
16 views

Runlevel 0 script not running properly on shutdown

I have a basic script where all it does is delete a specific user on shutdown. I made it executable and created a symlink to /etc/rc0.d/K99deleteuser so that it would actually run on shutdown. ...
1
vote
2answers
67 views

How to delete files selected by rules?

I have a large list of .mp4 files in one directory on a NAS(Network Attached Storage). Some are listed as follows : XXXXX_3800.mp4 and other like XXXXX_8000.mp4 XXXXX is the same for both ...
2
votes
1answer
442 views

shell script for connect server through ssh terminal?

How to write shell script for connect multiple server through ssh terminal. Its should open multiple tab in terminal and connect multiple servers through ssh ex ssh test@192.168.2.1 ssh ...
0
votes
1answer
42 views

Ubuntu 14.04 Remote shutdown teamviewer or php script

when I try to remotely shutdown with teamviewer my Ubuntu 14:04 pc turns off uncompletely because of the teamviewer team advice appear on the desktop (wine supported). I solved by running the coomand ...
-1
votes
0answers
8 views

ns2 script running for beacon_enabled_star

Since I m new in ubuntu for my project ,i want to know how simulate in ns2.Whenever i m running any code using nam it showing no directy exist or file is empty.Help me to run it.I want to create ...
0
votes
2answers
32 views

Message indicator after specific time?

Is there any tool this can indicate message after each 30 minutes of uptime ? actually I spend too many time on computer so i want tool which indicate message after every 30 minutes. like, when ...
0
votes
2answers
41 views

network manager - run script when connect failed [duplicate]

is it possible to tell network manager to run a script when network connection gets down (and it can't reconnect)? e,g: I have A bug in my network card driver, and sometimes NM fails to connect, a ...
0
votes
0answers
51 views

Make Install error FBReader - execvp Permission denied make[1]: [do_install] Error 127

Make install error . While i make install in the root mode it says this. make[1]: execvp: ./scripts/install_help.sh: Permission denied make[1]: *** [do_install] Error 127 i changed the path of ...
2
votes
1answer
43 views

Can simple scripts use GUI file manager to select file?

I have an extremely simple script that currently executes a command on a file located in the same folder: command ./file_in_folder option output. It would be better if script asks user which file they ...
0
votes
1answer
38 views

Network scanning script - cronification issues

This is (yet) another query about cron. I have referred to the guide on this site before posting here, but I still can't get this script to work. It is designed to suspend the PC when activity on ...
5
votes
2answers
340 views

Move multiple files to a dir if their names contain the same string present in dir name

I have multiple files in one folder: ABA.xy BEB.xy ACA.xy The same files with different extension in another folder ABA.rr BEB.rr ACA.rr Then I have single folder for each file name ABA BEB ACA ...
1
vote
0answers
39 views

Ubuntu 12.04 LTS scripts in /if-up.d not executed

Since this morning have been trying to achieve something: System: Ubuntu 12.04 LTS, Network-Manager is not installed Goal: Every time, the eth0 network interface is started (if-up.d) we want to ...