0
votes
2answers
34 views

Move images from sub-folders into new sub-folders

I have a folder composed of M several sub-folders, each of them containing some text files and N images (*.png) This is what the tree looks like: /parent/ /sub-folder1/ /data1.dat /data2.dat ...
0
votes
2answers
30 views

lscpu output differs when called indirectly?

I use lscpu | grep 'MHz' to get my clock speed. I am getting different results based on the method I am calling this command. Method 1: typing it in the terminal CPU MHz: 1200.000 Method 2: ...
1
vote
1answer
29 views

zip I/O error: Protocol error in bash script

so here's the script that i am trying to get it work: #!/bin/bash filePath="$1" fileName="$( basename "$filePath" )" backupDir="/my/backup/dir/${fileName}-backups/" dateTime=$( date ...
0
votes
2answers
57 views

How to edit a specific line of textfile in terminal with a script?

I need to change a .config text file every time the program doesn't work as I want it to. I want to be able to do it in terminal preferably with an alias and with the following logic: alias ...
0
votes
0answers
34 views

Run multiple scripts using one script on boot?

I need help. I've tried several methods to get this to work. Basically, I home host a server on my PC, the problem is, I want it to be online when logged in as every user on the computer. It uses ...
0
votes
1answer
73 views

Can someone explain the working of this bash script?

I found the following bash script which I would like to run, but I am not completely sure about what it is going to do. Can someone explain the working of the following bash script; i.e. what is it ...
0
votes
1answer
35 views

How to “show” the script, NOT run it..?

So basically, I uploaded a script to textuploader, and then used the wget command to download it to my /etc directory. Now I am able to run the script by typing: perl ...BUT, what if I want to see ...
1
vote
1answer
35 views

Command line to check version of a file with wget?

http://paste.ubuntu.com/7159470/ Is there a way to check the version of a file using wget, and then download it if it's newer? Trying to make an update script/launcher for a game. wget ...
0
votes
1answer
55 views

How to clear history from a script? [duplicate]

I am writing an script to dump my history log into another file "myhistory.log", and then clear that history. I have written the following set of commands: date >> myhistory.log history ...
0
votes
0answers
18 views

Automatic shut down and reboot at specific time [duplicate]

I have an assignment that requires me to write a script that shuts down a server at 11pm and reboots it at 6am daily. So far, I have only written a command to shut it down but I do not know how to ...
1
vote
2answers
70 views

Selecting multiple files with in bash

I want to use Scriptreplay with multiple log/timing files located in the same Directory. The script I have right now looks like this: select timings in /mnt/home/$USER/shell_logs/*; do clear ...
2
votes
1answer
60 views

Is there a command to scan my network and check the conflict IPs

It's hard job to find the duplicate IP when this happens. You know you have then to search all network IPs to check the duplicate. So is there a command line or a script to do that for me?
0
votes
2answers
167 views

How to grab a youtube channel

I always use youtube for getting many information I need. What i want is a script or a command line that grabs and installs all videos from a given channel path. I.e. I want to download all videos ...
0
votes
2answers
50 views

How to remove redirection unexpected syntax errors

I am loading using Ubuntu for beagleboard-xm sd card partition so after last stage of partition I have entered a command like this ./omap3-mkcard.sh /dev/sdX I have got ti-lab@KILBY:~/angstrom-wrk$ ...
2
votes
3answers
90 views

Create a .desktop file that opens and execute a command in a terminal

I would like to know how to write the Exec command of a .desktop file to open a new terminal and execute a shell script in it. The shell script is working and accessible by all users. When launching ...
5
votes
3answers
185 views

Evaluating a string in shell script

I am following this bash shell scripting guide: http://www.tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html In the section Numeric Comparisons, it cites an example: anny > num=`wc -l ...
1
vote
1answer
213 views

NDK_ROOT enviroment variable defined but script does not see it

In my ~/.bashrc i have this: export ANDROID_SDK=~/Devel/android_dev_x64/sdk export ANDROID_NDK=~/Devel/android-ndk-r9d export NDK_ROOT=$ANDROID_NDK export ...
1
vote
2answers
42 views

Echo command with color option in script and command works differently

If I run echo -e "\e[1;31mThis is red text\e[0m" in comand line, It prints out red text. However, if I use write it in script file test.sh #! /bin/bash echo -e "\e[1;31mThis is red text\e[0m" run ...
3
votes
1answer
38 views

How can “git gui” open repository from parent directory?

I start Git GUI tool using command git gui or git citool. I wanted to add another entry to right click script menu (already have dozens of commands) and created a script like this: #!/bin/sh git ...
3
votes
3answers
209 views

Rename files incrementally in a specific directory?

I have a directory containing bunch of .txt files , I need a command to rename these files by one command , so their name will be : file1.txt , file2.txt, file3.txt , etc . Any Help ?
0
votes
1answer
158 views

Cannot run cron job for a php script

I want to run a php script using cron job on localhost my script is situated at - /opt/lampp/htdocs/rrugd/myscript.php now as opt is under root, i tried adding the cron job for root as well as ...
1
vote
1answer
46 views

How can I get a file's UbuntuOne URL from the terminal?

How can I get the UbuntuOne URL from a file in a bash script? Here's what my script does so far: I run the script via Nautilus Actions, and it requires one parameter and an URL in the clipboard. The ...
1
vote
2answers
107 views

Create a Screen session with a bash script using contab

I want a .jar file to run every time the server boots up (we're using a VPS), and so I've edited crontab using crontab -e and then adding @reboot bash /home/bash/startserver.sh. But I haven't even ...
1
vote
1answer
53 views

How to check if a restart of open-iscsi was ok

I am working on a bash script to connect a iscsi initiator to a target. After I have edited the iscsid.conf in the initiator I have to restart the open-iscsi with the command: service open-iscsi ...
1
vote
0answers
42 views

Can I open a new terminal with a new binary executing in it?

I tried to write a script that opens a new xterminal with some binary file(not command) running in it.The whole script looks like this: #!/bin/bash XTERM="/usr/bin/xterm -bg WHITE -e ...
2
votes
3answers
290 views

How can I run this sh script without typing the full path?

I'm still very new to Ubuntu. I'm using 12.04, and I'd like to know if there is a way to run this program/shell script without typing: /opt/idea/bin/idea.sh It's kinda tedious and I'm quite lazy. ...
5
votes
1answer
100 views

Oneliner command to use kill given tcp port number instead of PID?

I often do e.g. sudo netstat -lpn |grep :8088 view the output tcp6 0 0 :::8088 :::* LISTEN 11189/java and then sudo kill -kill 11189 I'd ...
1
vote
1answer
67 views

Open a terminal a run a program on it automatically when the session starts

I have a script to open a terminal and run a command on it: #!/bin/bash export DISPLAY=:0.0 /usr/bin/gnome-terminal -e '/home/me/bin/application --option a --option b --debug' However, the ...
3
votes
3answers
79 views

How to concate strings in a bash script to use in SQL-Statement? [closed]

I would like to do the following in a bash script: read some filenames out of an file with filenames set a variable input path concat 1. and 2. use 3. in sql-statement Here my code: ...
1
vote
1answer
264 views

mysql statement in bash shell script does not work / syntax error

hope someone can help me! I do not know what's wrong with this script (Bash / Ubuntu 12.04 / Mysql / XAMPP 1.8.3). Try to read an input file with a list of csv-filenames (449-R11, 449-R12 ..) in order ...
0
votes
1answer
295 views

Creating and executing shell scripts to run XAMPP on double click [duplicate]

Basic Specs - Ubuntu 13.10, Gnome 3 (session fallback), Ambiance theme, Faenza icons. I recently installed XAMPP, now everytime i want to use the program i have to run the sudo /opt/lampp/lampp start ...
2
votes
1answer
64 views

Non-deterministic behaviour in bash script for screen window opening and naming

I have the following bash script to set up a screen session with four windows from the command line in 13.10. Comments indicate what I think it ought to do. screen -dmS mysession # start screen, name ...
0
votes
1answer
89 views

Problem while running script

I am getting error while running kafka-zookeeper script. Command i tried to run the script is root > /etc/init.d/kafka-zookeeper start Problem 2014-01-22 13:05:26,683] FATAL Severe ...
1
vote
1answer
150 views

Bash script, cannote replace string in a file with escaped $ and &

I have creatd a shell script which takes a string as input. If the string contains '$' or '&', then I need to raplace those characters with '\$' and '\&'. I could done that with sed command. ...
2
votes
1answer
130 views

Yad list columns

I need some help with Yad. This is my code: contact=$(while read line do firstname=$(echo $line | awk 'BEGIN { FS="|" } { print $2 }') lastname=$(echo ...
1
vote
1answer
55 views

piping using ssh without having to relogin for every pipe

I have an ssh connection and I have to send some local files and output to the ssh server. I know I can do this using the following command tar zcf - stuff | ssh user@server 'tar zxf -' I would ...
2
votes
2answers
321 views

Setting cron to run a shell script: random wallpaper from a webpage

I have written a shell script which downloads random wallpaper from a web-page and sets it as a background every 5 hours. Here is the script: #!/bin/bash countervar=1; finish=0; cd ...
1
vote
1answer
50 views

How do I switch desktop session users from a shell script?

I've got 2 users, foo and bar. Currently if I'm logged in as foo, I can select bar from the menu in the top-right of Unity, and since bar has no password set, I switch straight to bar. However, I ...
2
votes
1answer
72 views

How can I get a variable from terminal to use it in my script?

I'm writing small programs that are allowing me to do common commands with just two or three words max like sudo apt-get update I made it upt something like that Now I'm trying to write a script ...
-1
votes
1answer
60 views

Objective: understanding File permissions

I want to write a shell script that takes two arguments: username(usr) and filename(fname), then resolve and show permissions of the given user on the given file.
3
votes
2answers
94 views

How to automatically execute a command in a terminal after a period without activity?

I've been looking for an option or script that executes a command after the terminal has been idle (that's no input nor output). The closest thing I've found is setting the TMOUT=seconds variable so ...
0
votes
1answer
789 views

Double-click on .sh file to open terminal and execute series of commands in it?

I'm trying to double click on a file that does this: #!/bin/bash #Mount USB Jump, Copy files to it, Unmount it. [open terminal (so that I can see what 's going on)] pmount /dev/sdc JUMP sleep 2s cp ...
0
votes
2answers
227 views

how do I use upstart, instead of cron, to start a single instance of a job which should always respawn?

How do I script the following bitcoin/dogecoin/etc cpuminer command: /home/digger/cpuminer/minerd -o stratum+tcp://doge.pool.webxass.de:3333 -O <user>.<worker>:<worker_password> ...
0
votes
2answers
185 views

cron error: bad username

I've basically re-written the terminal output instead of appending a series of edits to this question: root@doge:/etc/cron.d# root@doge:/etc/cron.d# tail /var/log/syslog Dec 21 11:35:01 doge ...
0
votes
1answer
122 views

sending email if disk space exceeds

I have a script to calculate available disk space and alert by email if the limit exceeds a given value defined by me. Here is the script: df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 ...
0
votes
1answer
90 views

Concatenation in Shell Scripting Bash

I wanna check if 2 lines have equal $4 my shell must check if the diffrence between $3 in line 2 and $2 in line 3 is equal 1 it must concatenate both line into one like this 1;1000000000;1099999999;2 ...
1
vote
1answer
357 views

How do I get the filename from inotifywait events?

So I'm doing a simple inotifywait loop to watch for changes in a Bootstrap directory: while inotifywait -r -q --format %w bootstrap/; do echo "something happened" [[ $filename == *.js ]] ...
0
votes
0answers
20 views

kutil in a script

kutil need input multiple line parameters in order to generate a keytab file look at here. Can I make it just one line of command or can I put it into a script? And how?
0
votes
0answers
18 views

Starting Arachnophilia from shell script

I am using Arachnophilia which under older versions of Ubuntu, I was able to start using a shell script. After updating to 13.04 the shell script won't work. I opened up a terminal then cut and ...
0
votes
1answer
142 views

how to check if PPA is already added to apt sources list in a bash script

Do someone know how to check if a PPA is already added to my system before i add it with the add-apt-repository command in a shell script. That would be very helpful. Thank you.