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

learn more… | top users | synonyms (1)

0
votes
0answers
27 views

bash: [file]: No such file or directory

I have access to a cluster with six machines (wien0, wien1,..wien6) with /home/yhattori directory shared. I've installed a program (gaussian03) in wien6 machine at /home/yhattori/g03 directory where ...
0
votes
0answers
26 views

Edit /etc/environment via Command Line [duplicate]

I am using Ubuntu Server 14.04 and I would like to be able to edit the /etc/environment file via the command line to append the file with environment variables. This append operation is going inside ...
1
vote
1answer
37 views

Recursive Scan To Move All Files And Deleting Empty Directories

I am learning bash scripting and want to move all *.ort files to a new directory and delete the directory once the .ort file is moved. To Note: I do not need to keep same structure - I want to move ...
1
vote
1answer
24 views

Script Appends Extension Twice

I am running a quick bash script that will convert any .mov files to .mp4. This works great 99% of the time, but sometimes I hit a snare and I get an error of: the file /home/jgeoffrey/Documents/...
0
votes
1answer
25 views

Remove note about bash that appears when opening the terminal

I tried instaling ROOT by CERN by following steps described by certain people. But although that was unsuccessful, I keep getting the following line when I open a new terminal. bash: /home/USER/bin/...
0
votes
1answer
27 views

My bash script doesn't work when triggered by crontab, but works when i trigger it manually?

this is the cron entry */1 * * * * ./home/usr/automation/check_rejected_files.sh > /home/usr/automation/cronout it produce the file but nothing else happen, i added a date log in the beginning ...
2
votes
1answer
308 views

Bash 12 - 08 Value too great for base (error token “08”)

So, I'm trying to calculate 12-08 (not 12-8) and get the following error: let: 08: value too great for base (error token is "08") Here's the sample code: first=12 second=08 if [[ ($first > $...
3
votes
2answers
47 views

Prompt overwrite file in echo

I am writing to a file using simple echo (I'm open to using other methods). When writing to a file that already exists, can I make echo prompt the user to overwrite or not? For eg, maybe an argument ...
0
votes
1answer
24 views

trouble creating directory backups of selected directories

I have to a create directory backups of selected directories; each backup should have only one root directory; if multiple directories are selected, then each of them should be stored in a separate ...
0
votes
0answers
28 views

How to stop x11vnc from shutting down when I log out?

At boot I have sudo x11vnc -xkb -noxrecord -forever -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0 -usepw run via init.d It works and shows me the login prompt when I use a VNC ...
-1
votes
1answer
92 views

How can I open multiple html files with gedit from a script?

I have a list of HTML files I use for writing. I would like to script to open them for editing. HTML files are associated with Firefox as the Default Application on my system. New to Linux and ...
0
votes
1answer
33 views

vlc and launcher

I tried to add an entry to the contextual menu of the ubuntu launcher to be able to start .part files in the download folder. This is how it looks like: [Desktop Entry] Version=1.0 Name=VLC media ...
-1
votes
1answer
50 views

Help with “grep” command in terminal [closed]

I ran a command on a terminal in Ubuntu: $ grep "Director" file.lst And the output of that command was 1006|Pankaj | Director|sales|03/09/38|6700 I want know the full description of the output ...
2
votes
2answers
77 views

Why does sudo require a password the second time in a bash script every time? [duplicate]

I have a simple very tiny web app, and wanted to make my life a bit easier by having a very simplistic deployment script, that does the following: Pull updates from git Run composer Change owner of ...
0
votes
1answer
31 views

Script to send Email if Log grows past 90M

I have the Below Script to check the size of my Log file. Should it grow to beyond 84M to should be renamed with the current date and a a new one is automatically generated by my APP. However it ...
5
votes
1answer
68 views

need help creating an if statment that will work for my purpose in .bashrc

I have edited my .bashrc to look like this with some help from others on this forum ... Thanks guys for the help on the weather segment of this script... An issue I have ran into is the code for the ...
-3
votes
1answer
42 views

Scripting a script that tests a shell [closed]

I have a custom shell and want to test its arithmetic function. I wrote a script to test it and it performs the arithmetic but it is also trying to execute the result as a program. printf "******...
0
votes
0answers
15 views

Can't run rdesktop from desktop launcher

I have a problem with running rdesktop from .desktop launcher #!/bin/bash [Desktop Entry] Type=Application Terminal=true Name=11.11.11.11 Icon=utilities-terminal Exec=rdesktop 11.11.11.11 -u ...
0
votes
0answers
30 views

Ccrontab script returns empty output

I'm writing a simple bash script for analysing disk health status with smartctl and when i run it in a terminal or by script all works fine: for i in {0..5}; do echo "***** /dev/sda$i *****"; ...
0
votes
1answer
21 views

Variable is taking value as a file instead of text (String)

I'm trying to make a bash script in which I manipulate a download link with user input dates and such to then download the file. When I run it, it throws an error Final.sh: Line 16: http://real-...
0
votes
3answers
101 views

How can I run a shell script from bashrc file?

What I basically want to achieve is to type in a custom command in the terminal and a specific shell script should run each time. I could achieve the above requirement with folders,by modifying the ...
4
votes
1answer
38 views

Using binfmt-misc in conjunction with xattrs

I currently use a piece of sandboxing software on my 14.04 machine that isolates Linux binaries from one another (Using a special type of namespace isolation different than AppArmor) Currently, the ...
0
votes
1answer
20 views

Grub C Code in “set” output?

i made an interesting discovery. When i run set as root the output displays some c code... it seems like some grub boot-loader code.. followed by some unreadable parts. That seems a bit ... wired to ...
0
votes
0answers
32 views

Cron script runs but dpkg command fails

I have a cron script that updates a package with dpkg. This is an oversimplified version of a much larger script. But this is the part that is not working. I copy the update cron script to /etc/...
3
votes
2answers
32 views

How to read symbol separated strings from a variable, convert to numbers, and perform arithmetic?

In a bash script, I wish to pass in a string which is contained in a variable, and contains up to 3 substrings separated by the '+' symbol. Each substring will have a specific numeric value, sort of ...
1
vote
1answer
30 views

Add a delay to a keyboard shortcut

To put my screens on standby, I've defined a keyboard shortcut: xset dpms force standby This causes the screens to go into standby mode immediately. However, I'd like the computer to wait for 2 ...
2
votes
1answer
48 views

Bash prepends the symbol '@' to $PS1. How do I get rid of it?

I'm running Ubuntu 16.04 and bash keeps putting '@' in front of my prompt, regardless of the value set in ~/.bashrc. I've tried setting different values both in the ~/.bashrc file and from within the ...
2
votes
3answers
28 views

mv a folder and now the folder seems gone

I typed the following: mv /var/www/folder/ ../../ Now I can't find that folder or anything that was inside of it. What am I missing? /var looks like this: root@,my-server:/var# ls -la total 52 ...
0
votes
1answer
36 views

How to check computer's timezone through Terminal? [duplicate]

I am writing a bash script which at some point needs to determine a user's timezone, so how exactly can I check the timezone in Terminal? I would like to be able to get output in terms of GMT and UTC. ...
2
votes
3answers
292 views

Cyclic script execution

How to make the cyclic execution of the script? At the end of the script i need to run it again. Cron is not suitable, because i need to run the script immediately after the previous
0
votes
1answer
143 views

-gt: unary operator expected shell script

Getting this error after the upgrade packages in ubuntu. #!/bin/bash used=$(df -H | grep 'rootfs' | cut -d "G" -f 4 | cut -d "%" -f 1) limit=90 if [ $used -gt $limit ]; then Or [ "$used" -gt "$limit"...
1
vote
1answer
31 views

Hot Corners Musical Sequence Command Script

I am writing a script which uses hot corners to play specific musical notes when hovering in corners, and depending on the musical sequence to execute a specific command. The script is called with ...
2
votes
1answer
28 views

How to set up bash autocompletion to deal with file names like “./foo=bar/x=y.txt”?

When I start typing a file name that contains an equal sign, autocompletion with [tab] shows a strange behaviour: ls ./foo[tab] # autocompletion to "./foo\=bar" <- ok ls ./foo=[tab] # ...
0
votes
1answer
36 views

Is there any advantage to Rsync moving files on the same machine?

I was reading how to install Magento on Digital Ocean Ubuntu 14.04 VPS. All files are on the server. the author says: We will use rsync to transfer our Magento files there, since rsync will ...
0
votes
1answer
26 views

Bash script syntax

I want to create a .sh script which will execute a python file called match_scraper.py, update a psql db as shown, call a scrapy spider to execute. When I create the .sh script how do I call ...
3
votes
2answers
63 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
39 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
45 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
55 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
24 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
93 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
45 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 Mod....
0
votes
1answer
50 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 ...
1
vote
1answer
44 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
51 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 is:...
3
votes
2answers
324 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
111 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 ...
3
votes
3answers
222 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
459 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
41 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 ...