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

learn more… | top users | synonyms (1)

0
votes
0answers
6 views

Executing a Script in PowerBroker

I'm trying to script my commands that are run inside the pbrun shell. I've tried executing through a normal script, but that doesn't work because, to my understanding, pbrun is executed in its won ...
1
vote
2answers
27 views

How to set a default option for dpkg --configure -a?

How can I send a command like following, but with default parameters (without user input). I want to use this in a shell script. dpkg --configure -a ... ==> Modified (by you or by a script) ...
0
votes
0answers
11 views

Cron Job Not Executing Completely

While executing this shell script as a cron job it returns "Checking for ctl file"and does not execute any of the lines below. Shell Script cd /Input; ctl="/Input" echo "Checking for ctl file"; ...
1
vote
0answers
21 views

I need help for shell script

I need help for shell script, this script on my pc works ubuntu 14.10 but on samba server machine ubuntu 14.04 is show me error: tar you may not specify more than one -acdtrux' option --delete or ...
1
vote
2answers
44 views

bash - can shellcode be made from a bash script?

I was thinking it can't, since there's not really a binary for bash scripts, but having to write a C program every time you need to generate shell code for a single command is just a pain.
3
votes
3answers
647 views

Syntax error near unexpected token `('

When I use below code in Ubuntu terminal, it works fine: rm !(*.sh) -rf But if I place the same line code in a shell script (clean.sh) and run shell script from terminal, it throws error as this ...
0
votes
0answers
13 views

XML run bash scripts with parameters

I'm not very skilled in XML, so I ran into a couple problems. I want to start a bash script with a variable parameter, which is stored in an other xml file. this code is written by the supplier, and ...
0
votes
1answer
17 views

Steganography/Execute command

I made a program that encrypts commands and executes on the remote system, but after that I wanted to learn steganography and I have one question: Is it possible to attach a script to a PNG or JPG or ...
1
vote
3answers
27 views

How to run perform different actions from one script

How can I run different commands from one script? For example, if I want to run myscript new filename to create this file, and run myscript del filename to delete this file. At this moment I have a ...
1
vote
1answer
17 views

Losing environment info when using /usr/bin/sudo and /bin/bash

my question is why do I lose environment information like $PATH when running the following command: /usr/bin/sudo -H -u <user> /bin/bash -l -c '<command>' I'm trying to add the ...
0
votes
1answer
34 views

How to get a command to output the contents into Terminal, and my system clipboard [duplicate]

Let's say I have an alias on my system which I often use to tell me my system information, the alias is systeminfo, and it executes lsb_release -a which outputs: No LSB modules are available. ...
0
votes
2answers
34 views

Run python script when a file has been added to a folder?

Is it possible to run a Python script when a file has been added to a folder? In my scenario I have a folder that contains movies and the Python script gets the details (name, year, plot, rating, ...
0
votes
1answer
12 views

Unison and systemd timer problem

I've got a problem whereby if I run my bash script myself unison works as expected, when systemd runs it via a service on a timer then it does not work as expected. I'm logging the output of the ...
1
vote
2answers
25 views

roundign numbers perl

a vector I have looks like this v<-c(1,7,9,15,22,29,30,30,30,30,40,42,49,50,50,50,55) as I cant allow for numbers appearing more than a single time I would like to be the output like v ...
0
votes
1answer
41 views

Determine if current login is first for the month in Bash

This is a continuation of my post here Although A.B. provided me with the correct answer, which is by utilizing the output of last and checking if it's the current log in, it did not solve my ...
1
vote
2answers
33 views

Organising folders

I have several folders ("amazon", "niger", "rhine",...). Inside each of them I have several subfolders ("gfdl", "hadgem", "ipsl",...). Each subfolders is composed by 5 subfolders (e.g. in "amazon", ...
0
votes
3answers
50 views

Bash - create zip by finding files

I want to create bash script that find *.mp4 and zip it. I use this: #!/bin/sh zip -r $(find . -name '*.mp4').zip $(find "/home/ehsan/Desktop" -name '*.pdf') but not work and get this error: zip ...
2
votes
2answers
119 views

Saving generated passwords to a .txt file

random-string() { cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-8} | head -n 1 } Using this script to generate a list of several thousand random 8 digit alphanumeric passwords. Is there ...
2
votes
1answer
76 views

Bash script not running at startup from rc.local

I have written a simple bash script: #!/bin/bash echo "hi" > log exit 0 made it executable and its successfully running. I edited my rc.local to the following: #!/bin/sh -e # # rc.local # # ...
0
votes
0answers
10 views

ssh logout cause bash file problem

I have a .sh file which is called by a Node Web Server. In the .sh file I run some commands with my username [name], which is a superuser, without specifying the password. If I'm connected through ...
0
votes
2answers
37 views

End of file syntax error shell scripting [on hold]

#!/bin/bash source conf.ini inotifywait -m -e create /$1path | while read file; do if ($(echo $word | head -c 1)"=$1 then echo $file cd $1inputpath ls -l |grep $file* zcat $file* > ...
0
votes
1answer
21 views

How to change cmdline variables on boot or first boot

Not sure if this is the correct place to ask this question. I am running Ubuntu 12.10 on an EMB-3500 board. Its is an I.MX6Q. So my U-Boot saves the evn variable for my video as a development ...
2
votes
1answer
22 views

Remove list of files from different subfolders

I have a folder (call "folder"), composed of different subfolders ("subfolder1", "subfolder2",...). I would like to remove a list of files in all the subfolder of "folder", while some files are ...
2
votes
1answer
33 views

using wget to download xml for conky script won't keep html tags

So I'm trying to setup a conkyrc for weather, using the following script: #!/bin/bash station="KRAP.xml" wdir='/tmp/weather' update_xml() { if [ ! -e "$station" ]; then ...
2
votes
1answer
30 views

Copy/move a list of files to a new directory

I have an huge amount of files (e.g. 110011basz.dat, 110012basz.dat, 110013basz.dat,...) inside a folder, call folder. On the other hand I have a list related to the files I need to move to another ...
0
votes
1answer
14 views

Run a .sh on startup

I am creating a restore backup. When it start up I want it to run a .sh file that run a application and then reboots with out asking for a passcode. I have already built the .sh file but I have try ...
2
votes
2answers
82 views

How to merge values from two different text files?

I have following data set in text files: file1.txt a1:b1 a2:b2 a3:b3 a4:b4 a5:b5 file2.txt b2:c1 b4:c2 b5:c3 How to merge these values to make output file like this: output.txt a2:c1 a4:c2 ...
11
votes
2answers
607 views

Is there an easy way to log all activity that a shell script does?

Is there an easy way to log all activity that occurs from a shell script to a file? I have a script. It outputs things like echo "instructions", as well as other program output. I know the commands: ...
2
votes
3answers
57 views

Get variable from Zenity list generated from .csv file

I'm trying to get the value from zenity list. But it doesn't work. Some help would be nice :) If I remove the ans=$ I get the value from zenity in terminal like this: 10.33.54.13|10.33.54.13 But ...
1
vote
0answers
27 views

gnome-terminal / mate-terminal don't save history on ~./bash_history

Two days ago I was using my computer as usual, when I noticed that the commands I used in mate-terminal were not saved in the history. I tried installing gnome-terminal. But it does the same. I was ...
1
vote
1answer
22 views

What is the difference between 'exec ssh localhost' and 'ssh localhost'?

I read man exec output, but did not understand the difference between these two commands: exec ssh localhost and ssh localhost. I tested both commands and did not found any difference. Is there any ...
2
votes
1answer
23 views

phone book script

Good day I am a newbie in Linux scripting, and I am now exploring LINUX then suddenly I was motivated to create a program and I want to create a phone book program I am now done creating the menu that ...
0
votes
0answers
26 views

cannot execute binary file: Exec format error [duplicate]

i´m new in ubuntu and i´m trying to install a program created by one of my professors, but when i try to start it, the terminal send me the message: bash: ../bin/cidre.exe: cannot execute binary ...
2
votes
1answer
75 views

Store grive command output to variable in bash script

I am trying to create a script that syncs my computer with google drive using the grive tool. I would like to store the output of the grive command to a bash variable, but I can't seem to get it to ...
1
vote
2answers
615 views

Bash “unexpected end of file” on line 11, there is no line 11

I'm trying a new conky theme on my Lubuntu system, and for running it I need to start a bash script: #!/bin/bash #sleep 18&& conky -c /home/mathijs/conky/conky1&& sleep 1&& ...
0
votes
2answers
35 views

pipe whole script to file and terminal

i want a 1liner to pipe to file AND terminal at the same time(write 1 command, then all other commands are shown like normal in terminal, but output, preferably but not required : command name, to be ...
0
votes
1answer
43 views

I accidently ran 'sudo chmod -R 775 /' and it completely broke my OS/Shell [duplicate]

So I accidentally did sudo chmod -R 775 / when I meant to do sudo chmod -R 775 ./. I quickly realized and hit Ctrl^C, but not in time to save everything. I realize this is a really stupid mistake and ...
1
vote
1answer
30 views

Bash script exiting when repeated in double click execution

This is my code #!/bin/bash function boo { function goo { echo "Please enter name" read name; echo "Hello $name" } function xoo { echo "Please ...
4
votes
1answer
46 views

What does '*' mean in the output to 'history' command?

I was seeing my history when I found a line with a * whereas, in general, the history has an output without any * I noticed this for the first time. When does this * appear and why? EDIT: ...
4
votes
2answers
126 views

Terminal autocomplete functionality can only match from the beginning?

For example, if I type in "apt-"and press tab,I can find "apt-get" below.But if I type in "get", "apt-get" cannot appear. How can I do to match not only from the beginning?
2
votes
2answers
332 views

Uncompress file from URL to hard disk?

How to uncompress directly from terminal if I have the URL of the file? For example : unzip www.test.com/test.zip destination-folder-on-my-pc
1
vote
2answers
20 views

How to navigate to directory which file system object has just been moved to?

I often find when using mv somefile somepath I often need to go to the location which the file had just been moved to. basically mv somefile somepath && cd somepath is there a way to ...
0
votes
1answer
27 views

Running lubuntu 14.04, easiest, fool proof way, to create a desktop shortcut and to execute sh file from desktop?

It sounds easy, but hell, it is not. I want a desktop icon that executes: /home/<username>/dev/intellij/bin/idea.sh if I create a sh file on desktop, it opens with leafpad. If I create ln ...
2
votes
1answer
56 views

Who is telling me “You have mail”

On a server running Ubuntu 14.04 I see You have new mail in the motd every time I log in via SSH. Q: Who is telling me this? Mail does not find anything, and I do not expect any mails on this ...
1
vote
2answers
26 views

Is it possible to specify a different zshrc file on login over ssh?

I spend all day ssh'ing into servers for work and the remote user is one that is shared by myself and several colleagues so I can't just blindly customise the shell as not everyone will want my tweaks ...
2
votes
0answers
31 views

preseed file and installation script

I am using a preseed file to auto install ubuntu 12.04. I create a normal user account (able to use sudo), I skip the creation of a root account. At the end of the file I have put this (seen it from ...
1
vote
2answers
23 views

Accidentally changed shell in gnome-terminal, no longer opens

I wanted to make screenfetch start at terminal startup. But I realized that I changed the shell from bash to screenfetch and of course gnome terminal doesn't startup. I have installed MATE terminal ...
0
votes
1answer
39 views

How to run a web url script in a terminal

I am attempting to launch a script via my terminal. It runs fine in my browser but not in the terminal. Ive tried... sudo curl https://www.example.com/myscript?info=1 sudo wget -q -O- ...
0
votes
1answer
18 views

read numbers with e in awk

Hello a file I am working with looks: header // SeqT: {"POS-s":174.683, "time":0.0130084} SeqT: {"POS-s":431.49, "time":0.0221447} ...
2
votes
3answers
108 views

Bash for loop - how can I include blank newlines? (IFS) [closed]

Please note this is pseudocode, and I am not trying to count lines this way, this question is to figure out how to include completely blank newlines in a for loop. cat file word word Since ...