0
votes
2answers
17 views

Can't figure out JOIN command

I have two files and I'm trying to join them at a certain spot. I'd like to join them at the fourth column of the second file using the first column of the first. It's driving me nuts! Here is what ...
2
votes
1answer
43 views

script in bash not understood using terminal in Ubuntu 12.04 [closed]

Can anyone tells me what does this script means found in a .sh file:: [ ! -n "$T_R" ] && echo "Message Appear" && exit 1;
0
votes
1answer
47 views

Term Enviroment variable not set

This is the code that I want to execute through motd: #!/bin/bash IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'` #clear echo -e "Welcome to \e[0;32mDMS ...
0
votes
1answer
35 views

Script To Logout Root and Login User

I was wondering if there was a way to make a script that logouts of root or takes the automatic root login and logs in a user. This is for security reason so that the user cannot change important ...
2
votes
1answer
86 views

Script adding launchers to the top gnome panel

For a large number of machines running 12.04 with gnome-classic. I'd like to script adding launchers to the top left of the gnome panel. I know how to add them manually but this is a tedious ...
1
vote
4answers
166 views

How to make Start up script for Making Application run on startup

I have one jar which i need to run on startup and no matter whatever user is logged in and that need to take that user name automatcally here this code can take user name echo $(logname) and this ...
0
votes
1answer
173 views

How do I write an iptables rule to limit Internet bandwidth usage of user or IP address

How do I control or limit Internet bandwidth usage of users/computer/IP address in network with the help of iptables rules? I have one static IP address which provides Internet (that is, WAN). I ...
0
votes
0answers
17 views

Why is inserted media loaded under user directory? [duplicate]

case in point: I insert an SD card named TESTSD into my computer, It loads to /media/user/TESTSD instead of /media/TESTSD So far this only happened on two installs on different machines with Xubuntu ...
1
vote
1answer
78 views

Upstart script doesn't work

I'm trying to create my own script that gets executed on startup and stopped on shutdown (referring to the classic System-V init style), but it won't work! I've created this script ...
0
votes
1answer
335 views

startup script ubuntu 12.04

Each time I startup the sistem I need to run this command sudo xhost + and the sudo service myservice restart I have decided to add a script to startup to avoid having to type it each time myself. I ...
0
votes
1answer
50 views

export list of duplicate images on digikam/findimagedupes/fsplint/geeqie

I have 60000 images. And when I ask any of the following tools to come up with similar photos, all of them pop out a big list of around 3000 names of images. digikam gives a cool UI which lets me see ...
-1
votes
1answer
39 views

Rename default “Ubuntu one” folder on 12.04 server possible? [duplicate]

I'm running Ubuntu 12.04 server from home and using Ubuntu One as backup site. I'm not great at scripts (beginner) so when writing bash scripts that I later crontab for backups, having to use "Ubuntu\ ...
4
votes
1answer
106 views

Can't login after adding script to /etc/profile.d

I have created a little script to add bookmarks in Nautilus to redirect users to network share. If I run the script manually, it works brillantly but as soon as I try to add it in /etc/profile.d, I ...
1
vote
1answer
47 views

Could I make Automatic Backup Folder For All new files I create or download?

I want to make a folder for all the new files I create , some times I create them at different places (e.g Desktop , Download , Document etc ) The Question Why would I do that ? and The Answer Is ...
1
vote
1answer
60 views

Live CD: Script doens't work correctly after login

I have a PXE/NFS Server (192.168.1.10), a client PC and a diskless PC. I installed base ubuntu to client PC. I wrote this script (update.sh) to work after login to client PC. SERVER=192.168.1.10 echo ...
1
vote
1answer
212 views

Script not running in crontab, file not found

I need your help to run a bash script in crontab. As many other posts in askubuntu I'm facing the problem that a script that is properly running in terminal mode does not run in crontab. The error I ...
0
votes
1answer
40 views

script to backup file deleting file

Working on a bash script to take backup of a file, but the problem i get is that mv delete the file or rename it and create a file with the backupname. Script: test="/home/sysadmin/test/hei2.back" ...
1
vote
1answer
67 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
1answer
42 views

Check if connection worked if not return error

Working on a bash script to connect a iscsi client to a server. How do I put this command: iscsiadm -m discovery -t st -p 10.0.0.30 in a if to check if the connection was established, if not it ...
3
votes
1answer
127 views

Why doesn't the xbacklight command work in rc.local?

When I execute the command xbacklight -set 10 in my terminal the brightness is set to 0.1 as it should. But when I use this command in my rc.local-file, then it is not executed upon start -- because ...
2
votes
1answer
80 views

Bash script to check if mdadm is installed if not install it

I am currently working on a bash script to create raid5 with 3 disks and one hotspare. I am confused of how to create a script which first check if mdadm exist, if not it will install it and name it ...
1
vote
1answer
126 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 ...
0
votes
0answers
88 views

How can I fix this vncserver startup script?

I've been working on getting multiple remote desktops up-and-running on my new installation of Ubuntu 12.04.3 by following this guide: ...
1
vote
3answers
3k views

Writing a bash script to read a text file of numbers into arrays, by column, on Ubuntu

I'm trying to write a little bash script on ubuntu 12.04 and have little experience. Odd little problem converting a text file of numbers into arrays. I need all of the first numbers, second, etc into ...
6
votes
5answers
11k views

How to start Virtual box machines automatically when booting?

I have many Virtual box machines in my Ubuntu12.04, each time i shutdown or reboot i have to start them one by one. I wanna a help in writing script for automatically autostart the VBox machines ...
1
vote
1answer
59 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 ...
1
vote
3answers
123 views

How can I prepend a random letter/number to the beginning of each filename?

I'm working on a system where I'd like the first letter of each filename to be random - not necessarily unique, just random. I'd like to be able to run this from a cron job. For example, I would be ...
0
votes
1answer
1k views

Ubuntu FTP script to take backup and upload in my FTP server

Hie all I am trying to backup of my application directory, database backup and then sending it to my ftp server at hetzner by using the following script and i get few errors my server details: ...
0
votes
1answer
44 views

Add packages to Ubuntu Distro installation [duplicate]

I wanna create small change to Ubuntu Install CD. I want to add a few packages so when Ubuntu is installing, those packages also would be installed. So I wondering if it has some maybe ...
0
votes
0answers
100 views

Mapping Network Drives on Logon

I'm attempting to prepare some laptops for use in our school district with Ubuntu. I have them on the domain, and you can login with your ADUC credentials no problem. However, I'm stuck at what ...
3
votes
2answers
567 views

Script to clean system [closed]

I want a script to clean my system. Clean unused dependencies. Clean apt-cache. Clean residual-config files. Remove broken packages. Only keep the latest version of packages and remove ...
3
votes
1answer
2k views

How to set system-wide proxy address using shell script?

I want to set system Proxy address through my Qt application. So i was wondering if i could write a script which can be executed by my application every time to change the proxy address. I tried : ...
2
votes
1answer
5k views

Tomcat Installation startup.sh not working

So I've followed the list of steps on : https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04. When I try to run the startup script, I get this message: ...
0
votes
0answers
88 views

Command to map network share folder

I have a Ubuntu server as my file server. I then have other pc's and laptops on the same network. My server has ssh but default ssh port was changed to (2345) My question is what is the command that ...
0
votes
2answers
2k views

Bash Script using a Firefox Profile to open URLs

Working on a script to automate some tasks in Firefox. These tasks should run through a clean Firefox profile, so they are fast and don't interfere with any of my regular surfing. #!/bin/bash # ...
1
vote
2answers
62 views

trivia bug in bash script

#!/bin/bash aa=$( ps -e | grep "chrome" | awk '{print $1;}') for i in $aa do gnome-terminal --tab -e" sudo cpulimit -p $i -l 35 " done when i run it i get error missing argument e i ...
3
votes
1answer
535 views

Launching php script through comman line - keeping terminal window open after execution

Oh, my girlfriend really likes it when I launch php scripts! There's something special about them, she says ... Thus, I coded this script to run throught the CLI (Command Line Interface) - so it's ...
1
vote
0answers
220 views

Is it possible to use the conditional arguments in a preseed?

I am trying to create a preseed.cfg that is usable for a CD based installation and a network based installation. I figured the easiest way to do this would be to use a bash conditional "if". As part ...
1
vote
1answer
359 views

Disabling All Keyboard Shortcuts Ubuntu 12.04 LTS

Hey I want to lock down Ubuntu so that it only has access to chrome and the ability to logout. Is there a way to get rid of all keyboard shortcuts? Thanks for your help!
0
votes
1answer
180 views

On Ubuntu Server 12.04, how do I make a shell script that replaces underscores with spaces recursively?

So far I have: for file in *\_* do file_clean="${file//_/ }" mv --verbose "$file" "$file_clean" done However, it only renames files in the root directory of the folder. How do I make it rename the ...
1
vote
1answer
413 views

Run tasks after requesting a shut down

I have a small internet cafe with 7-9 Ubuntu 12.04 workstations. Unfortunately, I can't be there every week. I've seen a Java solution to upgrade the system, after a normal (non-sudo/admin) user ...
1
vote
1answer
36 views

A script to call /opt/myfolder/myscript

I am try to have it when I log into the server that all I have to do is type start myscript from the location of /opt/myfolderofscripts/myscripts and also have it say starting script. I don't want ...
1
vote
2answers
2k views

Auto shutdown server if there was no activity

My server should shutdown after 01:00 am, if there was no activity in the past hour. Lets say there was the last connection at 00:43 then it should check again at 01:43. How to write such a ...
0
votes
1answer
81 views

Logging every time a command is run

I want to log every time I run a certain type of command in the terminal. For example, every time I run: sudo apt-get install [something] I want to add [something] to a log file in my home ...
1
vote
3answers
831 views

How to run Shell script from HTML?

I'm somewhat new to Ubuntu Linux. I need to run the shell script from a html code. As I read somewhere like using Apache2 to generate a html and somehow I've succeeded to run a sh file from html, ...
1
vote
1answer
2k views

How to run a bash script in terminal but hide the terminal on startup?

I have a backup script on start up with cuttlefish. I set it on "Run in terminal" but I want to hide the terminal on start up. I also have the terminal in the start up applications. How do I hide the ...
11
votes
2answers
15k views

How Do I fetch only the numbers in grep?

I have file like this : other lines . . . blah blah blah (:34) I wish to find the occurrence of numbers in the above file. I came up with : grep [0-9] filename But that is printing the ...
0
votes
1answer
90 views

Where I'm making the mistake in here document?

I read the use of here document. I tried something like this: echo $* <<End anto End What I'm trying here is, when I run this script rather than taking input from command line, I'm asking ...
3
votes
2answers
381 views

rename files inside a folder in real time

Is there a way to rename files inside a folder as they're created? I could run a cron job every few seconds to do something like... find . -name "file.*" -exec sh -c 'echo mv "$1" "$(echo "$1" | sed ...
0
votes
1answer
154 views

Why doesn't this .desktop script launch the program?

The following script creates an icon in Dash Home, but doesn't launch the program. Any ideas why not? [Desktop Entry] Name=Civ 5 Comment=Civ & 5 Exec=sh -c "cd /home/mark/.wine/drive_c/Program ...