A shell script is a script written for the shell, or command line interpreter, of an operating system.

learn more… | top users | synonyms (1)

1
vote
1answer
197 views

Is Zenity progress bar affecting variables

Hi guys I am currently trying to implement zenity progress bar to my while loop, however I noticed that my variable which are meant to be incremented did not increment. Here is a sample test script I ...
0
votes
0answers
21 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
2answers
213 views

Cannot move file to subdirectory of itself

I'm having a little problem with renaming a bunch of files in a folder. The script: for file in $1 do mv $file $file | sed -r 's/^.{20}//' | sed 's/.\{16\}$//' done The output: mv: cannot ...
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 ...
1
vote
0answers
58 views

Lubuntu: script starting during lxsession for every users

i'm trying this, but in Lubuntu 13.10, the same script 1) in /home/user/.config/lxsession/Lubuntu/autostart works 2) in /etc/xdg/lxsession/Lubuntu/autostart does not works How can (and where) i can ...
-1
votes
1answer
69 views

How to run a script on Login [duplicate]

I want to get a script started on each login from domain users... how to do it? /etc/init.d/ is on startup not on login afaik.
0
votes
1answer
33 views

What is the order of execution of the scripts at /etc/rc0…6.d/?

The scripts linked at /etc/rc0...6.d/ have numbers at the begining right after the letter S/K, so the question is what is order of execution? From the lower to higher or higher to lower? I also would ...
1
vote
1answer
199 views

I'm parsing the output of `ls` and something went wrong

I made this simple script to copy a file recursively to many sub-directories. Here I am showing the problem for 3 sub-directories. I have 3 sub-directories and 2 files in a directory as follows ...
15
votes
5answers
4k views

Command to convert an upper-case string to lower-case?

What is the Bash command I can use to convert an upper-case string to lower-case and vice-versa? Thank you.
5
votes
3answers
517 views

Script that delete files after 5 days

Is it possible to make a script that will delete files in a specific folder, after five days without deleting the folder(s). I am using Ubuntu server 12 without gui interface.
0
votes
1answer
96 views

Running a script everyday using a cronjob

I need the exact code that I would use because I'm not able to figure it out. I use crontab -e to set up a cron job but when I save it, it never works. I'm also just trying to run a file called ...
0
votes
1answer
319 views

SSH - How to force execution of a script ( /etc/sshrc , ForceCommand, .. ? ) on login but still allow execution of the client's ~/.ssh/rc?

As far as i know upon SSH login the following files are executed [SERVER] /etc/environment [Client] ~/.ssh/environment -> can be locally overriden by "SSH_ENV" environment variable -> will ...
0
votes
1answer
179 views

Xdotool to automate moves in Epiphany (Boulderdash Clone)

I'm trying to automate critical moves in my favorite Boulderdash clone called "Epiphany" (available through Ubuntu Software Centre). In the following example the character should move: 3x "Down ...
-2
votes
1answer
173 views

How to fix the screen being to bright in Ubuntu 12.04 and up

How to fix the screen brightness and color being too bright in ubuntu.
0
votes
1answer
66 views

How to execute a script with Cron

I would like to schedule a simple script to execute when the machine reboots. I have other schedule other commands in crontab using @reboot without any problems, but I can't seem to get my script to ...
1
vote
0answers
157 views

How to use debcondf Show results with debconf-set-selections?

I'd like to know in common how to use the results of debconf-show with debconf set selections to precvonfigure deb packages with teh command line or within a shell script For example If I use sudo ...
0
votes
1answer
682 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
153 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.
2
votes
1answer
36 views

How to write a 'hotcorners' script in Python?

I'm using Lubuntu 13.04, and a feature that I miss from Compiz is the hot-corners: it simply runs some command when the mouse cursor reaches a corner of the screen. So, I was thinking about writing a ...
0
votes
1answer
111 views

UbuntuOne using bash script to copy files

I am new to ubuntuOne. I need to copy / backup a folder, using bash script. Is it possible? I did not find where are the local copies of the files, saved by ubuntuone. Thanks.
0
votes
0answers
18 views

How to creat scripts with daily summary

How to creat scripts which showing me daily summary containing the number of data sent and received for a pre-defined fixed networks applications (wget, SMTP, FTP). Thank you for any idea :)
2
votes
1answer
259 views

“Can't open” an /opt file

This is my first post. I wanted to ask for any idea so to solve my problem. I am using Ubuntu 12.04 LTS, and my purpose is to use OpenFoam CFD software. I am trying to execute an script called Allrun ...
0
votes
1answer
22 views

problem in address of one user

hi i want to do these jobs by one scripts: 1- read the name of current user (I don't know what is it!) 2- switch to root user 3- go to root directory 4- go to the desktop director of first user ...
0
votes
1answer
125 views

run a script as non-root user

I want to run a script say some_script.sh(that requires root permissions, contains some sudo do something in a for loop) as non-root user. I have a script as shown below. I want to run this script as ...
0
votes
1answer
104 views

How to close Teamviewer automatically?

I can launch Teamviewer from a script. I can start/stop/restart the daemon, also. But, how do I close down the app window automatically (whether it be from a script, crontab, whatever)? Thanks in ...
0
votes
1answer
56 views

Remastering Different Distros on ubuntu

I want to be able to remaster different distro on my Ubuntu 12.x system. I had an old red hat system that I did this on. I had a knoppix that I added a bunch of in-house scripts. Also I had the PING ...
0
votes
0answers
62 views

Interactive Script BEFORE Login

I have an interactive script that I need to run BEFORE loggin in. What I have setup is a Script that looks at a value I've set on the Kernel line from Grub ie. backuptype=create_image What I've ...
1
vote
2answers
330 views

How to disable screen lock timeout from a script?

I'm looking for a way to disable screen dimming and desktop locking timeout from a bash script on Ubuntu 13.10. The script should be run when user logs in (configured in Startup Applications window) ...
0
votes
1answer
82 views

How to make resume script wait for ivtv initialization

I have a TV tuner card with an infrared sensor. I have made a script to remove/start ivtv kernel module and shutdown/restart lirc service on suspend/resume. The problem is that the lirc service start ...
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
1answer
174 views

Restart then shutdown using bash scripting?

I want to restart and then shutdown from terminal. Means that we want to startup terminal after restart and then shutdown automatically. What I am doing with explanation: Manually start my pc Run ...
0
votes
1answer
3k views

How to restart Teamviewer daemon from a bash script?

I've installed TV as a server on a Ubuntu 12.04 box running 24/7. Unfortunately, the daemon service sometimes bugs and disconnects. I can fix this at the terminal with : sudo teamviewer --daemon ...
1
vote
5answers
140 views

Hide multiple files at once with shell script

I'm trying to hide some files with some command, I tried the rm command, but it did not work and also tried to rename but did not understand how it works. The files that I want to hide have spaces in ...
3
votes
3answers
258 views

How to get longest line from a file?

I'm interested to find out the line number of the longest line from a file. For example, if I have a file with the following content: lalala tatatata abracadabra mu mu mu how can I write a bash ...
0
votes
1answer
79 views

Shell script for “intelligent” copying

I'm working on a shell script. To the backgroud: I recorded a lot of songs from the radio with my Mac. Each song is a *.eyetv "file" on my mac. Actually these "files" are just folders, containing a ...
5
votes
3answers
260 views

Convey some message to all users

Is it possible to write a shell script that enables any user (may not be root) to set a message(e.g. "Download on progress do not turn off" etc.) which will be conveyed like pop-up message (zenity or ...
3
votes
1answer
543 views

How to create a script to check for internet connection?

I'm new to programming in linux. I started bitcoin mining using linux mint xfce 15. I'm really good following directions, just don't know how to start. I need to create a script that can run every 15 ...
0
votes
0answers
207 views

shell script won't execute in .config/autostart

I have a simple shell scrip I am trying to get to execute on startup. I use gnome-sessions-properties to add it to autostart, but nothing is happening when i start up. I am able to manually execute ...
0
votes
1answer
167 views

bash script to auto mkdir on usb

I'm trying to have auto script to open dir on any removable device - different usb have different names and i want the user only to enter the device name since the path /media/user is a default in ...
0
votes
0answers
15 views

How to run a script automatically if there is any specific hardware is detected [duplicate]

I want to run a script automatically when a headset was inserted on its corresponding jack and a USB modem was inserted on its corresponding ports. Any help will be appreciated!
1
vote
1answer
88 views

Multiple possible interpreters in a shebang?

Trying to learn me some nodejs, I installed npm and the learnyounode module. Unfortunately, learnyounode tries to execute #!/usr/bin/env node and not #!/usr/bin/env nodejs -- as we have it setup in ...
0
votes
0answers
53 views

start specific programs in different workspaces at user login

I've some programs that I always run after my login: eclipse, terminator, firefox. So I want to create a script, to put in .bash_login, and that will be executed only when I login in a gui. This ...
0
votes
0answers
75 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
152 views

Enter terminal mode with bash command

Is there a possibility to enter the terminal mode accessible with Ctrl+Alt+F1 with a bash command so that I can tell a script to do so?
0
votes
3answers
302 views

How to prevent script not to stop after apt-get?

I keep some bash snippets and copy&paste them when I needed for management. But I discovered apt-get cancels script execution. Here's my script where problematic. apt-get -y install gcc g++ make ...
1
vote
0answers
67 views

Why won't cron run my sh script?

Used gnome-schedule to create a script to set my headset as the fallback audio device because it keeps unsetting it when the headset gets disconnected or pc goes into sleep mode. Anyway, crontab is ...
2
votes
2answers
675 views

what could cause a script to fail to find python when it has `#!/usr/bin/env python` in the first line?

Trying to get casperjs running on Ubuntu 12.04. After installing it when I run I get: 09:20 $ ll /usr/local/bin/casperjs lrwxrwxrwx 1 root root 26 Nov 6 16:49 /usr/local/bin/casperjs -> ...
0
votes
1answer
94 views

Execute command on time Shell Script [duplicate]

I want to say I am a complete newbie but I want a shell script that will execute a command on a specific time for example on 6:45 am How is this done, a full example would be very useful! Thank you!
0
votes
1answer
52 views

Newbie question: running a custom script in terminal

I am complete new to Ubuntu, so please take it slowly: I'm trying to datamosh a video for my glitchart work and I've found a script (I THINK it's called script) for doing just that. But just can't ...
1
vote
1answer
56 views

ubuntu-vm-builder and first-login interactive script

I'm using ubuntu-vm-builder to create disk image on-the-fly. I want to use a script to change user keyboard on first login with --firstlogin argument with the following script : #!/bin/bash # Running ...