1
vote
1answer
18 views

Copying files and folders with cp with shopt extglob - error is not a directory

I'm trying to copy files from a directory while excluding a folder and a file. My problem is that a get an error with shopt extglob activated. Here is my code: ...
0
votes
1answer
23 views

Run some shell files from another shell file in different location

I have 5 shell files in a specific locations on my ubuntu system. I have two users on this system userA which is the main user and userB. Currently I have to manually open a terminal using user userA ...
3
votes
3answers
684 views

Why is the output of _$ _ when executed on a terminal?

I have executed the following command sequence: $ now=$(date) $ echo _$now_ _ $ echo _ $now _ _ Mon Sep 22 09:53:44 IST 2014 _ Why is the output of _$now_ only _?
-1
votes
1answer
14 views

Redirected Output

I just used a command ls -l > ~/ls_output in my /usr/bin directory and I'm not sure what happened. The terminal accepted my command but I don't know what happened to the output or where it went. ...
0
votes
0answers
22 views

Reading from /dev/urandom outputs a list of files in the current directory; why?

So I was playing around with /dev/urandom, and trying to sample one random character from it like so: read -N1 < /dev/urandom I know there are other ways to sample some randomness like the ...
-1
votes
1answer
39 views

Ubuntu 14.04 - Desktop icon is not running my BASH script

I have a simple script runme.sh which works when i run from terminal. #!/bin/bash chromium-browser "https://askubuntu.com/" But i need to make it now runnable for normal Users. So i place a desktop ...
1
vote
0answers
46 views

Display running clock in terminal [duplicate]

I want to display running clock inside terminal. I have already gone through this answer but this method only works in zsh terminal. But I want to display in bash. Is there any other way to display ...
6
votes
1answer
651 views

Difference between cd / and cd //? [duplicate]

What is the difference between cd / and cd //? We can see that adding / to the end doesn't do anything. But when I do cd // and pwd, I found: $ cd // $ pwd // What is difference between / and ...
3
votes
1answer
44 views

How to quickly check the value of bash variables, aliases and history commands from terminal?

How do you expand in place: bash aliases environment variables history commands to edit them and check they are correct? For example, I have some aliases I use for flashing different devices and ...
2
votes
2answers
44 views

Pass variable value to script from terminal

I like the shred command so instead of using the 'rm' command I prefer shred. I would like to create a bash script in /usr/bin, say we will call it "shredder" so that if I want to shred a file (i.e. ...
10
votes
5answers
884 views

How can I run original command that aliased with same name?

An alias for ls command in ~/.bashrc file aliased with this one: alias ls='ls --color=auto' then, when I run ls command in terminal aliased ls(ls --color=auto) runs. but my question is how can I ...
0
votes
0answers
43 views

Diffrence beetween ' and " in bash [duplicate]

Please bear with my stupid question. I want to know the difference between ' and " in bash. Please explain it to me with an example.
1
vote
3answers
67 views

Not able to run sed on bash script

I am working trough some legacy code which does not work, I came across a part that is causing problems. I was hoping some one could help me out and fill me in on what is the exact functionality of ...
0
votes
2answers
50 views

Bash script special character and background job bug

gnome-terminal --tab -e " sh -c ' gedit'/media/ubuntuman/Onces And for Al/scripts/faceBook' & ; sudo cpulimit -e ubuntu-tweak -l 80;'" This is the piece of code I want to edit. The special ...
0
votes
4answers
55 views

Creating a symbolic link to a directory

I have a directory to which I want to create a symbolic link. The commands I used were: cd workspace_b4a cd android-sdk-linux ln -sv build-tools/20.0.0/lib/ platform-tools/lib The output was: ...
7
votes
5answers
594 views

stdin/stdout- How to send a file as an input to another file?

Through the command shell we can redirect the three standard filestreams so that we can get input from either a file or another command instead of from our keyboard, and we can write output and errors ...
0
votes
1answer
45 views

bash: /etc/bash.bashrc: Permission denied I have no name!@lappyname:~$

During resolving another problem I run this command : pkexec chmod 0440 /etc/sudoers pkexec chmod 0440 /etc/sudoers.d/README mount -o remount,rw / Than after error occurs and after reopen the ...
1
vote
2answers
47 views

Reset History inside a bash script [duplicate]

I want to make a bash script that clears the history i.e. works similarly as the command history -c So I started with the following code:- #!/bin/bash history #displaying history history -c ...
1
vote
2answers
42 views

How to run .sh through terminal without using Nautilus Ubuntu 14.04 [duplicate]

I have an .sh file that looks like #!bin/bash exec /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/ java java -jar /home/me/myfolder/my.jar I've made this file executable and it works fine when in the ...
3
votes
3answers
78 views

How to differentiate command from the output using color

I have to differentiate command from the output using color like this $ cat file-name (this should be in some color say like red) some test in file OUTPUT (this output should be in some other color ...
1
vote
3answers
36 views

Cannot find location of permanent aliases.

A couple of months ago, I made a few permanent aliases for my bash shell on Ubuntu 14.04. They are actively making my life easier, and I would like to add a couple more to the list, but I cannot find ...
3
votes
1answer
94 views

How to send an email using command line?

Here's what I have: cat UserReport.txt | mail -s "TestSubject" "nospam@gmail.com" It's a small file, much smaller than a picture so it should send almost instantly. Though I receive nothing. I ...
0
votes
1answer
34 views

How to run bootinfoscript from the GParted liveCD?

How to run bootinfoscript from the GParted live CD? Windows 7 on internal hard drive, and Linux on an external USB SSD drive (Linux not loaded).
1
vote
1answer
38 views

Shell Script Problem

I decided to make a shell script for basic nmap scanning so I did it like this : #!/bin/bash sudo apt-get install nmap printf "enter the name of site to do basic scan on >>>" read NAME ...
0
votes
2answers
48 views

Bash error on opening the terminal

Whenever I open terminal in Ubuntu I get the following bash and I don't know how to solve it. I need a solution as soon as possible: bash: ...
1
vote
1answer
71 views

Bash script for multiple tabs program running

I have the following bash script code to open multiple session of a python script with different input argument in different terminal tabs. #!/bin/bash cd /home/me/experiment tab=" ...
0
votes
1answer
24 views

combine multible commands in one run one of them is find

I want in one line a command to use find to get a file name from a txt file , search for it , and play it then after closing the video I need to run a certain script I managed the first part but ...
0
votes
2answers
29 views

gnome-terminal profile without bash history

I'm trying to create a profile in gnome-terminal that doesn't store bash history. The easiest way to do that is to run export HISTIGNORE="*", but there is one problem, gome-terminal is executing ...
-1
votes
1answer
51 views

Run pkill without sudo permission

I want to run pkill like below. sudo pkill -u 11002 I cannot give sudo password multiple times, so I want to run pkill without sudo user. For this i copied pkill to home as named bkill, and then i ...
1
vote
1answer
54 views

Question about something appearing in my Terminal

After I moved from Windows to Ubuntu I liked to try out every new app I found so I decided to install Betty (a Siri like alternative for Ubuntu). I used the PPA given by Webupd8 site and the last ...
1
vote
2answers
47 views

.desktop file doesn't execute a script, works fine when run by hand

I am having problems with my .desktop files. I have a shell script that constantly watches for a file to be put into the "Downloads" folder. When a file is put into the folder it automatically ...
0
votes
0answers
30 views

bash: Permission Denied when I move my CPP file to another location

I crafted a test CPP programme. It created a file in the home directory. It compiled with ease, and I could run it by typing ./rocketfire in the Terminal. Now, I did these: abhimanyu@AbhimanyuPC:~$ ...
6
votes
2answers
351 views

Why do I get different outputs in case of sh and bash?

I have the following simple script: #!/bin/bash echo "Bash version ${BASH_VERSION}..." for i in {1..99..2} do echo $i done Output in case I run with sh file.sh: Bash version ... {1..99..2} ...
1
vote
2answers
63 views

Changing environment variables

I just changed my /etc/environment file to: M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1 M2=$M2_HOME/bin ...
1
vote
2answers
55 views

How to get a colored bash?

How to get the bash colored like this?
0
votes
1answer
80 views

Is sim a shell script command?

I was creating a sym-link for practice in Ubuntu 14.04. I meant to use this command: ln -s ../fun dir1/fun-sym It was taken from a book I am using. Except I used sim at the end by mistake. So the ...
0
votes
2answers
34 views

End script and restart it with the same options and arguments

Usually !! repeats the last given command. But it doesn’t seem to work in a bash script. Is there a way to end a script and repeat it with the exact same options and arguments given the last time? ...
0
votes
1answer
58 views

Run terminal command (python command) at start up [duplicate]

New to Ubuntu, but have looked everywhere to get this question answered. Found no solution so far. Basically I need to run two terminal commands on startup, which follow each other directly. This will ...
0
votes
0answers
70 views

Terminal flashing between current and previous screen

I just upgraded from Ubuntu 12.04 to 14.04. After upgrading the terminal will sometimes, but not always, flash between the current screen and the previous screen. Here are some examples: The output ...
0
votes
0answers
46 views

Terminal closing itself after 14.04 upgrade

All was fine in 12.04, in this case I'm using virtualbox in Windows. The upgrading process ran ok, no errors, no warnings. After rebooting the errors started to happen. Just after booting up there ...
0
votes
1answer
175 views

when building u-boot /bin/bash: arm-none-linux-gnueabi-gcc: command not found

I am currently running Ubuntu 12.0.4 on a 64 bit machine. I have an AM335X development board. Along with the kit came the compressed kernel (linux 3,2), rootfs, u-boot, and ARM cross compiler ...
2
votes
0answers
31 views

Echo difference between Ubuntu and Red Hat [migrated]

I have mostly been experimenting with Ubuntu but recently was using a Red Hat Enterprise system and was surprised at a difference I found setting and displaying env variables. In Ubuntu I might have ...
1
vote
1answer
36 views

Make password appear censored in bash script

I am going to make this short and simple. I am making a bash script where the user needs to enter their root password using the read command and it will be stored in a variable. What I don't like is ...
2
votes
2answers
68 views

What is wrong with this script?

So I got this script from this guide: www.tldp.org/LDP/abs/abs-guide.pdf LOG_DIR=/var/log ROOT_UID=0 LINES=50 E_XCD=86 E_NOTROOT=87 if [ "$UID" != "$ROOT_UID" ] then echo "Must be root to run this ...
13
votes
4answers
1k views

What does /dev/null mean in a shell script?

I've started learning bash scripting by using this guide: http://www.tldp.org/LDP/abs/abs-guide.pdf However I got stuck at the first script: cd /var/log cat /dev/null > messages cat /dev/null ...
0
votes
1answer
43 views

Running a .bash file in Eclipse

I know this is really an Eclipse issue but I can't seem to login in their forum. I am running eclipse juno for some c/c++ development.However, I wrote a .bash script that initiate the entire ...
1
vote
1answer
27 views

Bash searches for inexistent directories upon opening terminal

I tried to install IRAF a couple weeks ago but I couldn't get it to work so I ended up uninstalling the whole thing. Ever since, whenever I open my terminal I get this: bash: ...
18
votes
3answers
300 views

What is the $BASH_COMMAND variable good for?

According to the Bash manual, the environment variable BASH_COMMAND contains The command currently being executed or about to be executed, unless the shell is executing a command as the result of ...
3
votes
1answer
71 views

Is there a way to mirror directory changes in Terminator?

I'm on Ubuntu 12.04 and am using Terminator as my primary terminal. I like it because it lets me keep a python interpreter and bash terminal open at the same time, in the same view. What is annoying ...
0
votes
1answer
37 views

how to concatenate two strings in shell script in 3.13.0-34-generic kernel

I want to concatenate two strings for the shell file im getting error when i have created the shell file in following manner could you please suggest how to get it set export ...