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

learn more… | top users | synonyms (1)

-1
votes
1answer
27 views

Bash Script to periodically update images [closed]

How can I set up a script that will take the most current image in a folder on a remote server, and display the most current images on my host device. Possibly updating the image every 30 seconds? Any ...
2
votes
1answer
75 views

Stacking multiple for in commands

I'm operating on large amounts of data, and have a protocol involving several scripts. I launch it separately for each input file, simply swapping filename in text file containing the command. I would ...
0
votes
0answers
40 views

Copy standard output to file

Script 1 uses echo (and other commands) to standard output. Script 1 also runs other scripts, which also use echo (and other commands) to standard output. Script 1 is called by a scheduler that ...
2
votes
2answers
42 views

How to set environment variables separated by dots

I have to set an environment variable separated by dot in my tomcat startup script. For example host.name=localhost I know shell doesn't accept dot separated variables. Is there a work around ? I ...
2
votes
2answers
82 views

How can I find windows of a specific application and place them into a grid?

I'm trying to write a script to identify all open chrome windows and move them into a grid layout on a large screen I'm not sure how to find out what the best resolutions would be so I was going to ...
0
votes
2answers
29 views

-bash: ./configure: Permission denied

When I run the command ./configure in Ubuntu for installation of the siesta-3.2 software, bash complains with this: ./configure: Permission denied. How can I resolve this issue?
-2
votes
1answer
25 views

chmod u-x problem in case statement in Shell Script

I want to give rights to a file using a menu (exec,write,read). If you look closely I read value B( the file's name) then I use the case function to do the 1)exec / 2)write / 3)read function for ...
2
votes
1answer
19 views

How to delete User with User ID and GID 0

I just created a user with UID and GID to 0. Now when I access this user lets say "abc" will login as root. But when I loin as root i cannot list all the directories with ls command where i can do it ...
3
votes
2answers
151 views

changing string with sed, where did it go?

$ cat test-paths.txt test/sub2/configuration.php test/sub3/configuration.php test/configuration.php test/sub1/configuration.php $ cat find-host-test #!/bin/bash for i in `cat test-paths.txt` do ...
1
vote
1answer
23 views

scripting a “manual” apt-get install of kept back packages

TL;DR: is there a way to "automatically" install any kept back packages? I know that apt-get dist-upgrade is too blunt of an instrument. Details... I have a bash script that runs (periodically) to ...
4
votes
3answers
78 views

How I can monitor new files in a directory and move/rename them into another directory?

A program generates output textfiles, named output.txt, after every 15th iteration of a certain process. Doing so, it overwrites the last output.txt. I want to keep the files however, and I can't ...
1
vote
1answer
40 views

I cannot get grep to print results

Total noob here. I am blindly stumbling my way through bash. I realize that there is a syntax error in the following script but, I cannot figure it out. The script just sits there. #!/bin/bash ...
4
votes
2answers
62 views

Why my bash-script doesn't work with cron?

I created a bash script to automatically update my Ubuntu Server. Here is the script: #!/bin/bash apt-get update apt-get upgrade echo "Update am $(date "+%d. %m. %y|%H:%M:%S) >> ...
1
vote
4answers
108 views

bash shell script

How do I write a bash shell script that requests the user's name, verify that it exists and, if it does, show the following information: Username: xxxx User ID: xxxx Group ID: xxxx Shell: / bin / xxx ...
1
vote
0answers
21 views

sed single qoutes, double qoutes, delimeters [duplicate]

I am confused a little bit. I would like to swap 2 directory in the apache2 config files with the sed program. APACHE_CONF=/etc/apache2/apache2.conf FULL_DIR=/home/$USER/new ...
0
votes
1answer
32 views

How to execute an script as daemon with nohup?

Supose I have a script "script1.sh" and I want to execute it as a daemon with nohup and &, and make it be "waiting" for a signal. How should I do that?
12
votes
1answer
443 views

How to get the PID of my script?

If I have the script "script1.sh" and I want to make it print its own PID as a first step. How can I do this in bash?
3
votes
2answers
202 views

How to execute all scripts in a path?

Suppose I have a script that receives a path as a parameter. How could I execute all the scripts located in that path?
0
votes
0answers
21 views

Bash script not creating screen

I have a script that I wish to run on a screen. The screen that already exists is killed correctly, however the screen is not created and the command not run. Any ideas? #!/bin/sh screen -S attorney ...
5
votes
1answer
239 views

How to automatically install a program bash suggests I install?

I am thinking of the use case of this output: The program 'tiger' is currently not installed. You can install it by typing: sudo apt-get install tiger How can I get it to prompt me to install ...
1
vote
1answer
21 views

Combine setsid with .bshrc alias or launcher

To run program X, I currently have to type path/to/folder/X in my terminal. I made an alias in my .bshrc so I can type X directly, and I have created a launcher so I can access X directly from my GUI. ...
5
votes
3answers
216 views

How can I execute the last line of output in bash?

I know I can run the last command in bash, with !!, but how can I run the last line of output? I am thinking of the use case of this output: The program 'git' is currently not installed. You can ...
0
votes
0answers
15 views

How can the outputs of sounds be set by command in PulseAudio?

I'm trying to automate the setup process needed to pipe the output of Festival speech synthesis into Skype for the purposes of allowing a person who cannot speak to have a synthetic voice on Skype. I ...
0
votes
1answer
37 views

Anyway to get full bash working on Windows? [closed]

So I love the Linux CLI environment and I like to use bash for almost every task I can. For some reasons too long to explain, I'm leaving my Ubuntu 14.04 LTS to move to Windows 7. I have heard there ...
3
votes
5answers
172 views

Generating several random numbers within a range

I want to generate, say 10 random numbers between 100 and 200 (both included). How do I make it with rand?
16
votes
1answer
1k views

Why does bash thinks that 010 is 8?

Why does bash think the number 010 = 8? x=010 echo $x 010 echo $(( x+0 )) 8 echo $(( x-2 )) 6 I thought it might be binary, but 010 = 10 = 2. So why does it get 8, and how can I make it think ...
14
votes
9answers
639 views

How to write a shell script to assign letter grades to numeric ranges?

I want to make a script that would prompt you for a number between 0-100 and then give you the grade based on the number. I'd like it in bash. PS3='Please enter your choice: ' (Something here) do ...
1
vote
1answer
18 views

Unusual characters in Brace expansion of characters in bash

I was generating random characters for some purpose. By mistake I try the following in a terminal and got some surprising result. I am using bash shell provided by Ubuntu. $ echo {Z..a} Z [ ] ^ _ ` ...
5
votes
3answers
338 views

In bash, is there a way I can make shorter (if or) statements?

if [ foo = bar -o foo = car -o foo = jar -o foo = foo ] then echo yes fi To keep things more organized, I would like to try to match it to a list, such as if [ foo = {bar,car,jar,foo} ] ; ...
2
votes
4answers
118 views

Parse lines with specific pattern out of file

I have a file that looks roughly like this : [25]:0.00843832,469:0.0109533):0.00657864,((((872:0.00120503,((980:0.0001 [29]:((962:0.000580339,930:0.000580339):0.00543993 ...
0
votes
0answers
13 views

problem with tmux startup displaying running config. (powerline)

I just installed powerline using this tutorial: http://askubuntu.com/a/283909/408189 I have a problem where the first thing i see when i open tmux with the command: tmux is what looks like the ...
0
votes
0answers
54 views

/usr/bin/ld: cannot find entry symbol _start; not setting start adress

My MakeFile is being executed with following options/flags: g++ -nostartfiles -g,-Wl,-O1 -Wl,-rpath,/opt/Qt5.4.0/5.4/gcc_64 -Wl,-rpath,/opt/Qt5.4.0/5.4/gcc_64/lib -o qml-material ...
0
votes
1answer
35 views

How to change the color of stdout content?

I need to change the output color of stdout in terminal, That means I need to show the outputs in colored contents. For that I have tried like this. Bhuvanesh: May$ tput setaf 3 ; ls ...
3
votes
6answers
306 views

Use bash to extract number from between square brackets

My file looks like this: [581]((((((((501:0.00024264,451:0.00024264):0.000316197,310:0.000558837):0.00857295,((589:0.000409158,538:0.000409158):0.000658084,207:0.00106724 ...
0
votes
2answers
70 views

Shell script I made is ridiculously verbose, and also is probably inefficient. Help!

I am new to Ubuntu, and so far have done several things I am quite proud of: Made an apache webserver with my own html (before a week ago I had never touched it) Made a stratum mining server +titcoin ...
1
vote
1answer
22 views

Maven 2 mysteriously showing up in $PATH

I'm upgrading to maven 3 but have hit a small snag in that maven 2 is mysteriously showing up in my PATH variable. I've checked ~/.bashrc, ~/.profile, /etc/bash.bashrc, /etc/environment, /etc/profile ...
1
vote
1answer
25 views

Secure Shell isn't propery loading .bashrc

I've got a seemingly simple issue - I have a 15.04 server that I connect to via ssh. Currently, I have a couple of folders added to my PATH environment variable in my .bashrc file: #... (rest of ...
13
votes
2answers
871 views

How to enable suggestion if command not found (“did you mean…” feature) in “bash” shell?

Similar to this question: How do I remove the "did you mean..." feature in the shell? When mistyping a command you get something like: root@pc:~# sido No command 'sido' found, did you ...
0
votes
1answer
27 views

ENV variable within an ENV variable in upstart script

I'm trying to include one ENV var in another in my upstart script: env CONFIG_NODE_NAME=my_$HOSTNAME_node But it doesn't translate it, it just keeps it as $HOSTNAME.
1
vote
1answer
162 views

Run multiple line as a single line command bash

Is there any way to run multiple line as a single line command in bash script. This is my multiple line bash script id=15; if [ $id -ge 30 ] then echo Successful echo $id else echo fail echo $id fi ...
1
vote
2answers
55 views

How can I know which file is being used in a bash for loop?

I have a very tricky question that I have been wanting to tackle for quite some time. If $line is from $(cat foo), then do action1 If $line is from $(cat bar), then do action2 for line in $(cat ...
0
votes
1answer
16 views

Script to generate thumbs only if thumb doesn't exist

I have a working script to generate thumbs to all pdf files in a folder( using Image Magic): for f in *.pdf; do convert -thumbnail 250x200 "$f"[0]"_thumb_wd_${f%.pdf}.jpg"; done How can i adjust ...
2
votes
3answers
173 views

Creating a folder based on a portion of a file name

I have several files named such: KILN_SDUS51_N0SILN_201203020003 KILN_SDUS51_N0QILN_201203020003 KILN_SDUS51_N0RILN_201203020003 I need to file all of them into folders based on the three ...
3
votes
2answers
126 views

How move the biggest file in each subdirectory to current directory?

I like to loop though subdirectories and move the biggest file to its parent and then delete the folder. I have tried many things but never got it working correctly. It says that mv cant find the ...
2
votes
1answer
23 views

antlr4 alias not persisting

I'm trying to set up Antlr 4.5 as per the instructions here but the alias isn't accessible from where I've put my project after a reboot, which makes me wonder if I've done the classpath step ...
1
vote
3answers
267 views

split large file in bash

How can I pass all files in a list.txt which looks like file1_1.txt file1_2.txt file1_3.txt file1_4.txt to the split command (there are other txt files in the dir) and make it return the parts ...
1
vote
1answer
56 views

script sh syntax error [closed]

I have this script: #!/bin/bash IP='192.168.1.1' fping -c1 -t300 $IP 2>/dev/null 1>/dev/null if [ "$?" = 0 ] then echo "Host found" else echo "Host not found" fi When I try to run it, ...
1
vote
1answer
37 views

cannot change directory with script [duplicate]

I tried the following script to give myself convenience in changing directories to different hard disk partitions. But after its execution, the default location does not change, but if I use command ...
1
vote
0answers
24 views

Terminal Closes On Running clear and large output commands

When I run the clear command or ctrl+L or commands with large output like ps aux, my terminal closes. I have set the scrollback to unlimited.
0
votes
0answers
37 views

Xinput command in autorun script doesn't execute

I use two monitors 15 inch and 19 inch. With the 15 inch I also use a touchscreen. I have to map touch events to 15 inch monitor with this command: xinput map-to-output 11 VGA1 11 stands for id ...