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

learn more… | top users | synonyms (1)

3
votes
2answers
54 views

Shell script password with special chars

I've build a shell mysql backup script which works very well. It only has problems with passwords with special chars like this: xgT{uic[Is?uJ+. Here is the important part of the script: #!/bin/sh ...
0
votes
1answer
31 views

repair ~./profile file

I just messed up with ~/.profile, tried to add something to PATH, but looks like there was a syntax error in my code and now the login screen functionality won't work and I can use ctrl+shift+f1 tty ...
1
vote
1answer
37 views

What is POSIX-compatible mode in Linux?

The book says : When in POSIX-compatible mode, bash will emulate sh. What does this mean? What is meant by emulation in simple layman terms?
1
vote
1answer
48 views

Bash script cannot run with keyboard shortcut

I have this script in my /home/username/ And I can run it via terminal with the following code ./script.sh or sh script.sh it works (it has executable permissions) but I cannot assign it to a ...
0
votes
2answers
22 views

run two ongoing processes on startup with one that needs initialization time

I'd like to record start recording utility consumption right at startup but I can't find the right combo of operators, pipes, and sleep commands to enter into crontab -e . I think my smartest attempt ...
0
votes
1answer
83 views

I can't switch “switch to Downloads directory” using bash (I'm new to this)

I'm new to programming and trying to download Swift on Ubuntu on Windows 10 Insider Preview. I'm now running bash on Ubuntu, I'm trying to get to the Downloads directory. I tried cd ~/Downloads and I ...
-1
votes
1answer
36 views

start screen programm with crontab @reboot

I try to start a start.sh at reboot with crontab. But nothing happens afer a reboot, and the log is without an error. Does someone know what i've done wrong? For testing i gave the start.sh and ...
0
votes
1answer
47 views

What command is the most effective for listing processes? [closed]

I've seen lots of developers use ps -ef to list processes and kill them (such as in ENCOM, devs of OS-12). However, there is also htop. A friend told me that it is only a wrapper around ps and ...
0
votes
0answers
33 views

Link broken but when “ls” is used on link in terminal the content is displayed

I noticed an interesting fact today. I have a link on my Desktop pointing to windows partition (dual boot Ubuntu 14.04 & Win8.1). Because this partition is not automatically mounted the link is ...
1
vote
1answer
36 views

rsync can't exclude directories

I run this cmd to backup my folders: $ rsync -av --exclude {/mnt/dati/Film/, /mnt/dati/Scout/} --delete /mnt/dati/ /media/cirelli/HD1TB/backup/dati sending incremental file list And rsync answer ...
3
votes
2answers
317 views

Command line IF not working as expected

I'm relatively new to the terminal programming. I'm trying to run an IF condition within a FOR loop. (The command is to be run by a cronjob) for i in {1..5}; do echo $i; if [ $i>3 ]; then echo $i; ...
3
votes
1answer
104 views

Apache startup script keeps lock file open

I am writing a bash script for a backup task. Among other things (file system freeze, database lock, snapshots,...) it involves shutting down Apache and restarting it after the Backup. Since that ...
0
votes
2answers
38 views

Custom commands with options [closed]

How to create custom shell script/command with flags/options ? $ command -t 2 -h "File"
3
votes
3answers
217 views

How to rename all files in folders with pattern

I have a bunch of files like: bla.super.lol.S01E03.omg.bbq.mp4 bla.super.lol.S01E04.omg.bbq.mp4 bla.super.lol.s03e12.omg.bbq.mp4 I need to rename them all like: s01e03.mp4 s01e04.mp4 s03e12.mp4 ...
0
votes
1answer
90 views

Syntax error near unexpected token `newline' while installing Predictionio

I'm new to Prediction.io and when I try to install it following the instruction at this page I get the following error: bash: -c: line 0: syntax error near unexpected token `newline' bash: -c: line ...
1
vote
1answer
35 views

Gnu date input formats

I am trying to get my head around the date input formats used in date -d "something" Specifically I am trying to understand the use of the "Day of week items". The manual page for date refers you ...
1
vote
1answer
29 views

Aliasing gedit to suppress terminal output

I am SSH'd into an embedded board (Jetson TK1 running Ubuntu 14.04). I use the -X option so I can use gedit to edit text files. When executed from a terminal, gedit spews a bunch of garbage on the ...
1
vote
1answer
162 views

Note Taking Using Command Line History

Is executing a line, beginning with a hash-tag, like #something, in a terminal, dangerous? Something like: usr@machine:~$ #something Or in a multi-line manner: usr@machine:~$ <<something ...
2
votes
1answer
55 views

How to use sed with file path variables AND regex callbacks AND arithmetic expressions

I'm having a hell of a time getting the proper syntax using sed with variables containing a file path, a regex callback and an arithmatic expression. I don't know how to properly escape things. I ...
0
votes
1answer
29 views

what does -alt |more command do in ubuntu

can some one explain what does -alt | more command do in UNIX with what is the function of alt,-, | and more.
1
vote
0answers
45 views

Non-printing characters showing up in terminal prompt

Without color my prompt looks like this: [0] [dimo414@dimo414:/tmp] $ echo $PS1 | sed 's/\x1b/\\e/g' \n[0] [dimo414@dimo414:/tmp]\n\$ I add some color and \[...\] delimit it: [0] ...
0
votes
2answers
46 views

How to write a recuring bash script

I created a program that requires a sequence of command line instructions to scrape new information and update the databases. Is there a way to automate this process so I don't have to type all this ...
1
vote
2answers
47 views

Execute a command stored into a $variable

I made a script where I wrote: COMMAND="/usr/bin/exiftool $PATH_NAME" .... code .... $COMMAND The variable $PATH_NAME is assigned dynamically inside a while loop. The command works fine until it ...
0
votes
2answers
36 views

“mv” apparently deleted my script!

My command was: mv count_entries.py ~/journal_tools/ Now the file is missing from both ~ and /journal_tools/... If it matters, I was logged in as a user without administrative rights, and ~ is a ...
0
votes
1answer
49 views

Openvpn - Terminal blocked after starting connection

i have a little Problem with openvpn. I want to establish a VPN connect with open vpn, then get a file from an FTP Server and than close the connection. The VPN and the FTP are working fine. But if ...
1
vote
2answers
50 views

Bash script help, check permission 755 on all files in a folder

I'm attempting to create a bash script where I check if all the files of a specific folder (/tmp) have the permission 755. I also need it to delete all the files that don't have permission value 755. ...
2
votes
1answer
34 views

How to run a parameter as an alias in a shell script?

I have an alias alias ll='ls -lF'; I created a bash script temp.sh: #!/bin/bash # Allow aliases to work in bash NON-interactive mode! shopt -s expand_aliases # .. and load them source ...
0
votes
1answer
20 views

Protect root-owned script against tampering and run unattended w/ sudoers' NOPASSWD

Using /etc/sudoers I gave a non-root user (anyuser below) permission to sudo-execute a root-owned script (test-script below) with the NOPASSWD: tag set. The script's permission octal value is 0550. ...
2
votes
1answer
24 views

echo create command, what's it doing?

I've been trying to figure out what this line does for a few hours. I have to automate the step using ansible and can't find anything on the create command. Any help is appreciated. echo -e "create ...
3
votes
3answers
54 views

how do i make shell ask for confimation for rm -rf command (even sudo)?

I want to make the command shell to prompt me for confirmation before execution of certain commands like dd , rm -rf etc.
0
votes
0answers
20 views

Batch file to read file contents and iterate

I am trying to write a batch file/shell script that reads the contents of a file, matches those contents with a directory structure and invokes an executable file. Let's say there is a sequence.txt ...
0
votes
0answers
18 views

Escaping in Bash [duplicate]

I want to do a POST with curl for a DNS entry, but the quoting/escaping drives me crazy. I tried the following in Bash (which I want to transfer to a Bash script once it works): curl -k -u $USER -X ...
0
votes
0answers
19 views

How can I make a list of my most used commands including commands used including sudo [duplicate]

How can I make a list of my most used commands. I have tried the answer from How can I make a list with most used commands in terminal? but it does not include the names of the commands I used with ...
2
votes
1answer
56 views

Automate unity launcher icon ordering

I have written an install script which automates my install process. Afterwards I would like it to rearrange/add/remove the icons to the unity launcher. Using dconf watch / I can see output as I ...
0
votes
0answers
16 views

Scripts (suddenly) not running from Nautilus

I wrote some scripts, set Nautilus to run executable text files without asking, set the files as executable and everything worked as advertised. I double-click my scripts, they open up in ...
1
vote
1answer
15 views

What is the difference between --init-file and --rcfile?

I've been working with bash, and I came across the --rcfile and --init-file options. Bash's man page lists these under the same section, but they seem to behave differently. Take the following ...
0
votes
1answer
34 views

Why absolute path doesn't work for binary execution?

I am running Docker and I'm trying to use a binary which is located in a shared folder (I shared the folder via "-v host/folder/path:guest/folder/path"). The folder works fine, I am able to see the ...
0
votes
3answers
32 views

How can I use a script to get the IP address from ifconfig if the size of the IP changes in size with each connection?

I'm currently working with this IFTUN="$(ifconfig tun)" IPADD=${IFTUN:106:13} echo $IPADD But if the size of the IP address changes this isn't going to work anymore. inet ...
0
votes
5answers
61 views

How can I kill a process with a phrase in its name? [duplicate]

I need to kill a process that contains myName in its description. Currently I'm doing: ps -ax |grep myName I see PID kill -9 PID How can I do the same with one command without entering the PID?
0
votes
0answers
36 views

ksoftirqd/0 using 100% cpu

I currently have a process that is using 100% of cpu its the ksoftirqd/0 the issue is I have 4 cores on this machine but it is only using one for this. I found this answer ...
0
votes
0answers
38 views

GNU GRAB version 2.02 + Keyboard does not work

GNU GRUB Version 2.02~ beta 2-36ubuntu3 Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists possible device or file ...
0
votes
0answers
24 views

pacemaker corosynce lsb resource script( Sybase Database ASE Server and Backup Server)

I'm trying to create a lsb resource with pcs on rhel7.2 The "sybase" script is about Sybase Database ASE Server and Backup Server Startup & Stop & Restart $ status script The script is all ...
0
votes
1answer
47 views

New Terminal bash file error

Upon opening a new terminal in Ubuntu, I get this error. I tried opening the bashrc file but It seems to be empty. bash: /home/rma/prac/devel/setup.bash: No such file or directory bash: ...
0
votes
1answer
34 views

Bash script that runs a command with arguments and redirects

So I'm trying to execute a command in a bash script multiple times with different but same number of arguments while redirecting the output to a text file. For example ... ./test arg1 arg2 arg3 ...
1
vote
1answer
21 views

How can I use the in-built function alert in Gnome Schedule?

I want to access the alert function in Gnome Schedule. I can run alert from my default Bash command-line but receive the following error in Gnome Schedule: /tmp/tmpxi4X16: line 1: alert: command not ...
4
votes
1answer
769 views

Where is the Ubuntu file system root directory in Windows NT subsystem and vice versa?

I have installed Ubuntu subsystem on Windows 10 (after enabling feature in settings), but where is the Ubuntu file system root directory located in the drive?
0
votes
1answer
23 views

Concatenate two paths

I want concatenate following: current_dir=/home/akshay/UCS source_dir=/lib/python2.7/lib-dynload/ I want to produce something like this: /home/akshay/UCS/lib/python2.7/lib-dynload/ and then I ...
2
votes
0answers
35 views

Facing errors with running shell scripts at startup and poweroff

I am using Ubuntu 14.04 LTS and I want to run 3 scripts at startup. They are named as follows: voe.sh startUp.sh and runDown.sh The script voe.sh is the main file which will in turn call the other 2 ...
0
votes
0answers
19 views

No desktop and Loading Icons. . . Issue

I've recently installed Ubuntu 15.10 onto a virtual machine, however after logging in there is no icons or anything on the desktop, just the cursor and the background. I have looked online however am ...
-1
votes
1answer
31 views

Some programs print errors to stdout instead of stderr, and don't set $? when an error occurs. Why? [closed]

See title. I've seen this twice recently, with both udisks and pacmd, and they are 100 times harder to script because of it. Why do programmers do this? For example, I want to switch the audio output ...