Bash is the shell used in Ubuntu's command-line interface.

learn more… | top users | synonyms (1)

0
votes
1answer
164 views

remapping shift key and bash script startup problem

My keyboard both shift key malfunctioned, my OS is Ubuntu 13.04. So I am using one of the control key as shift key. I did this using xkeycaps tool, and that's working fine and I need to do this ...
2
votes
3answers
86 views

Mysterious > prompt from missing right apostrophe

If I type for example grep 'needle > I get sent to a mysterious > prompt from which ctrl-C (or restarting the terminal) is seemingly the only escape. What is this prompt? Why doesn't it ...
1
vote
3answers
528 views

what this following bash script file do?

while browsing through hidden files of my home directory , I have found .bash_logout. I came through this content in the file if [ "$SHLVL" = 1 ]; then [ -x /usr/bin/clear_console ] && ...
0
votes
1answer
191 views

Several questions about shell scripts [closed]

I'm making a rather big (at least i think so) shell script which includes a host side and a target side. The host being an actual computer running Linux/various distros and the target being a ...
0
votes
1answer
571 views

Does anyone know about avconv scripts?

I want an avconv script which automatically scans some of my directories and then checks for .avi files and then converts them to .mp4 and then deletes the .avi files when finished. I am not a bash ...
3
votes
2answers
3k views

Open URL from Bash script

I have a text file Google.com Youtube.com Gmail.com Yahoo.com I am trying to open them with Lynx. Here is the thesis. I will store all of those links at a txt file, say links.txt and then I need ...
0
votes
1answer
302 views

Init.d script problem

The init.d script is installed properly and by me i wrote the script correctly. But i have a very strange situation. The script executes a multi-threaded program written in c++ by me. If i execute the ...
1
vote
1answer
171 views

What are all the possible commands on Ubuntu Touch?

I'm trying to figure what commands are available in Ubuntu Touch before I think about installing it on my phone. I've figured out that apt-get is there. But what about dd, top and ssh etc., etc.? ...
2
votes
2answers
127 views

How to create scripts that create another scripts

I am writing an script that needs to generate another script that will be used to shutdown an appserver... This is how my code looks like: echo "STEP 8: CREATE STOP SCRIPT" stopScriptContent="echo ...
3
votes
2answers
653 views

find does not work with my variable

I'm trying to find the number of dirs and files in a given dir. I'm running my bash script like this: ARCHIVE=/path/to/archive ./myScript in my script I am doing this: #find the number of ...
0
votes
1answer
771 views

Who | awk Bash script

I am receiving the following error when attempting to run my script: ./watchuser: line 12: syntax error near unexpected token `echo' ./watchuser: line 12: `echo ("$User online since:" who| awk ' { ...
0
votes
1answer
265 views

Cant create a file and write to it from a .sh script

I am trying to create a file and write to it using a .sh script but is not working(Nothing is being created, and I don't see any error). This is how that part of my script looks like: ...
4
votes
2answers
261 views

How can a function/script tell Xterm from Terminology?

I want to have a function in .bash_login that displays text if the current terminal is XTerm, but NOT Terminology. When I do echo $TERM in Terminology, it outputs xterm How can I tell them apart?
1
vote
2answers
458 views

Script won't run properly in crontab, no path or permission problems

I use the geany text editor, which has a command line option to list all open documents. The following command works fine when run from the command line: /usr/bin/geany --list-documents > ...
0
votes
1answer
99 views

Moving bytes from one files to another

I have an empty file (only zeroes are in it) of size 9,0KB and I need to write another file (with size 1,1KB) to it, but the first file must not lose it's. So if the whole file is 00000000000000... ...
0
votes
1answer
2k views

Can't redirect standard output

I'm following along with the examples in Chapter 6 Redirection of The Linux Command Line (2012). I am trying to redirect the standard output of an ls command to a text file. I keep receiving a ...
1
vote
1answer
128 views

I can't rename a file using the terminal if it came from a parameter

I am automating some deployment task with an .sh script but at some point I need to rename a file but it is not working. The file change can be different but the postfix is the same. Let's have a look ...
0
votes
1answer
271 views

How do I automatically change to a specific folder on login for an account with no home folder?

Typically I would create a user account and in the home folder, place the cd command in the ~/.bashrc file. For system users, however, with on home folders, the /etc/bash.bashrc file is used instead ...
1
vote
1answer
519 views

How to use sed with this complex expression of special chars and ips?

How to use sed to replace for example this expression: connection = sqllite///keystone@10.10.10.51 with this expression connection = mysql://keystoneUser:keystonePass@10.10.10.51/keystone
2
votes
2answers
6k views

How to change my shell to real bash?

By typing echo $0, I know I'm using tcsh in my Ubuntu 13.04 terminal. However no matter using chsh -s /bin/bash or just typing bash still can't make bash as my present shell. The interesting thing is ...
0
votes
1answer
1k views

Calling function in another bash script

Let's say; Script a.sh has function f1 defined. Script b.sh needs to call f1 to use. How do I do that? I searched online, it says I have to edit some PATH vairable, but does it mean global PATH or ...
0
votes
2answers
2k views

Where should I add/modify environment variables?

I would like to edit my .bash_profile file. However it appears that in Ubuntu (and perhaps other Debian distros) this is named as .profile. However I cannot seem to find the expected variables like ...
3
votes
2answers
3k views

How to launch a terminal from script and another script to run in terminal

I run a script when I log in that basically looks like this: chromium-browser & xchat & cd ~/randomdir && gnome-terminal & qbittorrent & On the third line (cd ~/randomdir ...
0
votes
2answers
207 views

Some Bash questions for a newbie

I am studying Bash, but there are some things that are not explained in my book. First I'll post a script, and then I will ask questions going through scripts. Bash Script: $ cat sortmerg ...
2
votes
2answers
5k views

Problem with crontab, script runs when executed from command

this is my cron entry: */5 * * * * /home/user/scripts/backupDB.sh && echo "Backup Successful: $(date)" >> /home/user/tmp/mybackup.log This is the script that is called: #!/bin/sh ...
12
votes
3answers
1k views

“quote” command in the shell

What is the usage of the command quote? I haven't found any info about it, it isn't among the executable files in /bin folders, and it cannot be found among Bash built-ins. It seems that it only ...
8
votes
4answers
3k views

How can I play a song in the background via my command line?

I have installed play : sudo apt-get install sox libsox-fmt-mp3 I can now play my audio files like this : play Desktop/SONGS/01\ -\ Oh\ Baby\ Girl.mp3 Since I'm learning shell, I wish I could ...
0
votes
4answers
275 views

How to access/delete a folder accidentally named with escaped characters? [duplicate]

I was setting up a cloud server and saw that I accidentally added a folder named ^[[4~ (with escape code). I want to see what is inside and if that was just a mistake then remove that directory. ...
0
votes
1answer
1k views

How to terminate application called from bash script?

I want to call some application from script. I use an application which doesn't allow any parameters in CLI but I need to test it in two different monitors and screen resolutions so I have two ...
2
votes
2answers
6k views

Get the default Firefox profile directory from bash

I'm trying to get the profile directory of the default firefox profile (the one that opens automatically) from Bash. How could I proceed? I can't find any useful options issuing firefox --help
1
vote
1answer
124 views

How to use ' and " (quotes) as an argument

Intro In a script I want to run a command in a separate window so that output of the command will show in a new window (which is an output stream like top) and they do not interfere each other. For ...
1
vote
1answer
2k views

Sudo su setting default password automatique [duplicate]

I'm a newbie linux (Ubuntu) user and i have a question to sudo su, I always like use the root in the shell for no annoying privilgies errors :) But the problem is sudo su always ask me for a password ...
1
vote
1answer
158 views

Cronjob Bash not exporting

I have written the following script to run for when users have last logged in. I am trying to export a cronjob to a .out file. For some reason, I cannot get it to export. #!/bin/bash for User in ...
0
votes
3answers
53 views

filename substitution — is there something to make sure it is not a certain letters?

What is the command for getting a filename with any character EXCEPT a few? Say I do not want the filename to contain the letters q and Q ls [^qQ] does not work. What would I do?
3
votes
1answer
606 views

Why default .bashrc is set to return immediately if not running interactively?

In Ubuntu default .bashrc there's this: # If not running interactively, don't do anything [ -z "$PS1" ] && return Does anyone know why that is there? Is there something in the bashrc that ...
3
votes
1answer
3k views

How would you go about backing up a remote Ubuntu VPS via SSH?

So, as I said I have a VPS, Raspberry Pi and a plan, but I am in need of some advice, so here goes. I have a VPS with prgmr.com which I ahve up and running nice and smoothly without any issues. I ...
3
votes
2answers
91 views

Find files where the filename is only different by case

I need to get a list of all the files that only differ in case. I.e., if I have a folder (with sub-folders) with the files: one.txt ONE.txt two.txt three.txt three.TXT four.txt five/5.txt five/6.txt ...
0
votes
2answers
343 views

Can I use source test1.sh with gnome-terminal -x?

I am executing 2 shell scripts from the main using source. main.sh: #/bin/sh a=1 b=2 c=3 gnome-terminal -x sh -c ". ./test1.sh|less" (note the source ".") gnome-terminal -x sh -c ". ...
12
votes
2answers
9k views

How do I use 'notify-send' to immediately replace an existing notification?

When I use notify-send to show a notification on the desktop, and then use it again to show a different notification, I have noticed that the second one only shows after the first one has disappeared. ...
0
votes
1answer
848 views

How to display number of lines that are blank or contain these characters

I have to count the number of lines that contains comma, apostrophe, or is a completely blank line. I know to count the number of blank lines I would do egrep -xc '' filename But I am not so sure ...
2
votes
4answers
236 views

Using filename substitution — How to search for files with letters in this order?

So I need to find all files which have d, o, and g in the filename. The letters do not need to be side by side (aadaaoaagaa would be a correct filename, aaoaadaag would not be a correct filename). It ...
0
votes
1answer
126 views

Outdated rosewell adapter driver

Someone suggested that this error when running the install.sh script for my roswell network adapter RnX-N180UBE was caused by these drivers not being compatible with ubuntu 13.04, is this the case, ...
1
vote
1answer
29 views

Issue with Rosewell network adapter

When running the install.sh script for my roswell network adapter RnX-N180UBE I get an error Cannot change ownership to uid 1007, gid 501: Operation not permitted If anyone has any experience with ...
0
votes
1answer
110 views

How would I display the lines that do not have certain letters? [duplicate]

How would I display the lines that do not contain certain letters? This is what I have already tried unsuccessfully to show the lines that do not consist of an a or b: egrep *[^ab]* filename
2
votes
1answer
3k views

Passing multiple commands to gnome-terminal from a script

My bash-script is not run in a terminal, but opens a terminal at runtime to ask for user input (sudo password). I would like to tell the user in this terminal what the script is trying to do. First, ...
-1
votes
2answers
174 views

Is there something in grep similar to what * is in filename substitution?

I am required to find all lines that start with a capital letter AND ends with the word dog followed by a period. I know that to find lines starting with a capital letter I would do: egrep ^[A-Z] ...
0
votes
1answer
78 views

Program interface is ugly when started by script

I am starting Qt-Linguist in a bash script via sudo linguist-qt4 $PathToParentDir/translate_$lang.ts I could also use gksu instead of sudo but this would add more dependencies since most people ...
2
votes
1answer
111 views

How to copy files to desktop for every language?

My bash script should copy files from /opt/test/file.txt to the user's Desktop. The source path is always the same, but how do I copy to desktop? The desktop has a different name in every language... ...
1
vote
1answer
666 views

Get system locale language code in bash for a dynamic path

Here is my bash-file: #!/bin/bash PathToParentDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" sudo linguist-qt4 $PathToParentDir/translate_de.ts What I need is that my bash script ...
0
votes
1answer
5k views

Setting system wide proxy through bash script (Temporarily)

I'm trying to temporarily set the system wide proxy option which is available as GUI in the Network Settings through bash script. I only want the proxy to be applicable while the script is running and ...