In shell scripting, a shell such as bash runs a file containing a list of commands (a script). The script is effectively a program and the shell is its interpreter.

learn more… | top users | synonyms

6
votes
3answers
6k views

How to run a script during boot as root

I had a script that automatically enables my wifi without using networkmanager, but I don't know how to run the script as root while the system is booting. How do I make the script run automatically ...
8
votes
2answers
11k views

Why doesn't rc.local run all my commands, and what can I do about it?

I have the following rc.local script: #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # ...
0
votes
1answer
174 views

An alternative to init.d?

Is there an alternative to Ubuntu's init.d? Like a way of starting and stopping daemons that don't require those monstrous init.d scripts: # cat /etc/init.d/skeleton #! /bin/sh ### BEGIN INIT INFO # ...
5
votes
3answers
257 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 ...
0
votes
2answers
423 views

Where to start in Linux programming [closed]

I am a student and I would like to study all these terminal stuffs and all. You all will be experts in this subject. I would like to know where did you all begin and what must I do to be an expert in ...
3
votes
8answers
375 views

How to sort by row from terminal

I was looking at this question and I wondered if the following could be done from terminal. I did it in python, just want to see if it could be done from terminal, bash scripting or whatever. ...
2
votes
3answers
216 views

Extracting a part of a massive csv file from command line

I want to read parts of a big csv file between rows n and m and between columns p and q. Is there an easy way to do this easily with the shell? (Are there commands I should read the doc's? otherwise, ...
3
votes
1answer
148 views

How to check in a bash script if passed argument is file or directory?

I have to write a simple bash script in Ubuntu which would allow me to pass it some arguments and I want to check if these arguments which can contain spaces are files or directories. How can I do ...
3
votes
2answers
189 views

Getting values from variables - bash script

I am trying to write a bash script to print values of the 3 variables. Keep getting errors. What am I doing wrong? INPUT1=/tmp/dir1 INPUT2=/tmp/dir2 INPUT3=/tmp/dir3 for i in 1 2 3 do echo ...
2
votes
1answer
446 views

How to run a command at login?

I need to run the following command (with real parameters) after login: ssh -f user@example.com -L 54321:example.com:54321 -N I need it only for my user, not all users on the machine. Also, I need ...
1
vote
1answer
42 views

How can I remove an entry from a list in a shells script?

I have the following script: #!/bin/bash # Bash Menu Script Example PS3='Please enter your choice: ' options=("Option 1" "Option 2" "Option 3" "Quit") select opt in "${options[@]}" do case $opt ...
0
votes
1answer
3k views

Compilation error when installing Realtek 8192cu driver

I'm using a laptop with Ubuntu 13.04 64 bits. After "fighting" for some time, I gave up trying to have my Realtek 8188ce wireless card work properly (the wifi connection is annoyingly unstable). So I ...