Bash is a free shell for Unix-like operating systems, from the GNU Project

learn more… | top users | synonyms

0
votes
0answers
37 views

Bash Prompt : incorrect time displayed

Using the following prompt: export PS1="\n[$(date +%d-%m-%Y)] \u@\h [\t]\n{\w} [\!] # " and with TZ to my timezone : echo $TZ = America/Montreal The time on the prompt is OK at the start of a ...
0
votes
1answer
63 views

Using EXPECT script with a $ in the password

I'm trying to set a variable in a Linux bash script which includes a $ symbol, i.e. password is Gl@d1us$123 so PASS="Gl@d1us\$123". I can preceed the $ with a \ and it works fine, but when it calls ...
0
votes
2answers
24 views

Copy shell configuration from one machine to another?

I've got login to another server where shell configurations are not like I would want. For example I don't see my username and CWD on prompt, and when I press arrow key, instead of giving last entered ...
0
votes
1answer
27 views

How to use find to fill in variable in Shell script

I am making simple Shell script form some boring-ever-repeating job. Script changes directory correctly, and now I want to run other scripts based on argument I typed when running script. Other ...
0
votes
0answers
22 views

How to rewrite bash shell script to nyaos script

I'm using this small shell script named zip0 in linux environment. #!/bin/bash zip -0rq "${1}.zip" "./$1"; I also want to use this function in windows nyaos script. By direct input from shell $ ...
1
vote
1answer
34 views

Using Bash, how can i delete all the dektop.ini in my external drive folder tree?

I am using my external HDD to store my music, and now I've installed linux on my pc. I would like to erase all the desktop.ini files in the thousand nested folders on the HDD, how can I accomplish ...
0
votes
1answer
59 views

How to get xterm-like split windows in Debian (ubuntu)

I'd like to achieve this effect in Linux. Essentially I'd like to have vim open on the left and have a command line on the right to perhaps tail an error log. Ubuntu 14.04 on my desktop, but CentOS ...
0
votes
1answer
29 views

replacing subString in an Array BASH

what i got: array[0]="Programm is Running" array[1]="programm is down" what i want: array[0]="Programm is \e[0;32mRunning\e[0m" array[1]="programm is \e[0;31mDown\e[0m" this will make things a ...
0
votes
2answers
42 views

Filter a list of strings with arbitrary condition

Is there a way to leave only those strings that pass some (potentially any) condition? It is trivial to filter strings based on the fact that they themselves match some pattern (with grep). But what ...
0
votes
0answers
93 views

Local echo using Screen to connect to a serial terminal

Reading through the book "Building Wireless Sensor Networks" I learned that you can use the Screen utility to attach to a serial console. I tried using it to connect to an XBee module and it seemed ...
0
votes
0answers
31 views

File or folder not found error, but the file exists

I downloaded the android ADT bundle for Linux(my distro is Elementary OS), and after I unzipped it, I opened the folder sdk/platform-tools on terminal, and tried running the adb file. When running the ...
0
votes
0answers
31 views

How to open a local file with a query string appended to it in the default browser?

I want to do something like this from a shell script: $ open 'foo.html?foo=bar' Sadly that fails, as it looks for a file named foo.html?foo=bar instead of foo.html before opening the browser: The ...
1
vote
3answers
41 views

Invalid Argument when moving items to new directory. Command works anyway

Here are the steps I took: cd ~ nano .bash_profile alias dtcl='cd ~/Desktop; mv * Desktop\ Cleanup' Ctrl - X Y Save If I run dtcl, it totally works. It moves everything ...
2
votes
1answer
31 views

Dynamic directory hash

There's a nice method in zsh called hash -d with example usage: hash -d magic=/very/long/name/$USER/even/more Then I can cd ~magic/deeper. Is it possible to achieve the same result but so that ...
0
votes
1answer
47 views

email command not working in UNIX Linux

I tried with 2 email UNIX commands mail and mutt from my Red Hat Linux box. It's not sending any mails to the email id I specified. echo "My message" | mail -s subject "test email" <my valid ...
0
votes
1answer
29 views

Recovering a file in Linux

I securely deleted a file in Linux by: 1) First encrypting it with AES (cipher block chaining) 2) Then using srm which does 38 passes (as explained in man srm) Any pointers on how to recover it?
0
votes
0answers
18 views

Cygwin broke something when trying to install new software

I was trying to install some OpenGL libraries and something strange happened so I stopped the update. Now, when I use cygwin, ls doesn't work and whenever I open up a new terminal window I get my ...
0
votes
1answer
50 views

Append an index number to a variable name in bash?

I am trying to loop through numbered variables but am having a hard time appending the loop index number to the base variable name. Code follows, using a 2-iteration example: #ENTER TOTAL NUMBER OF ...
0
votes
0answers
57 views

Linux Mint 16 32-bit (Ubuntu) forgets password, even after resetting via grub/bash trick

I just installed LM16 using a live USB stick. Install went fine, and at the user step I made a password but chose 'log in automatically'. On first boot without the usb stick, it logged in without ...
0
votes
1answer
38 views

What is the most effective linux program to perminanlty delete a file?

Some people recommend, whipe, srm, shred, etc. Is there one best assuming that the goal is to make a file irretrievable, regardless of time/space taken to delete? It would also be great if you could ...
1
vote
2answers
41 views

How do i run su username -c “command ” in a sequence

am trying to write a script that runs commands in a sequence as a user but su keeps doing every command at the same time instead of running them one after another the script looks like su username ...
0
votes
0answers
74 views

Getting a batch file to run windows 7 psr tool

I'm trying to run the Windows 7 problem steps recorder tool on a remote computer using screenconnect. Screenconnect allows you to quick launch files remotely, so I'm using batch files. The goal is to ...
1
vote
2answers
118 views

If, else based on command piped to grep

I can't figure out how to make this (what supposed to be simple) script to work. Basically what I want, to run different stuff based on the state of my Parallels vm, something like this: if [ prlctl ...
0
votes
0answers
21 views

Connecting to ssh and using screen not working properly

I used once ssh -t <login@server> screen -R to connect to a server and everything worked fine. I used the terminal in the server to execute an script and then detach the screen. I came back ...
3
votes
1answer
63 views

Why does my .bashrc get read when I run noninteractive commands over ssh

I've prepended each of my bash config files (~/.bashrc,~/.bash_profile,~/.profile) with echo NAME_OF_FILE, i.e. I get '.bashrc' when I source in ~/.bashrc. What baffles me is why I get and ...
0
votes
2answers
163 views

Delete empty column from csv file with bash script

Looking for some way to look at a csv file and delete columns including the header that have no values in the subsequent lines that follow. Perhaps if I wanted to delete column Test03 from below ...
1
vote
1answer
52 views

Can't find clogin command for rancid

I'm new to CentOS and setting up Rancid (only used rancid, but new set it up). I've having an issue were I type clogin as my rancid user, however i get command not found ...
1
vote
1answer
22 views

How can I restrict a bash find to only specific sub-sub-directories

I'm trying to list all the files in a specific sub-directory but different directories which are themselves on a different volume. The following works, but only on a fully specific sub-directory (and ...
0
votes
1answer
32 views

Execute dynamic command into all screen sessions

I am working on setting up a minecraft server network in ubuntu server 14.04 LTS. I have several screen sessions each with their own process running in them There are screens on: 2471.LobbyServer ...
1
vote
3answers
73 views

How can I restore my /bin/bash file?

I am facing a problem with my terminal (Ubuntu 12.04 LTS) . I was making some changes in the /bin/bash , but I have kept a backup of bash.rc in case of something went wrong. Anyway today I have tried ...
1
vote
1answer
68 views

Simplest way to verify if a given string is a valid FQDN name?

I need to supply either '-name' or '-sname' when starting an Erlang VM depending on whether the given string is a fully qualified name (FQDN) or not. What would be the quickest and ...
0
votes
1answer
19 views

Bash is losing history even though shopt -s histappend is set

I lost all commands that were executed from the last session - they do not show up in history at all. What needs to be done to prevent this?? I had added shopt -s histappend just for this ...
0
votes
0answers
40 views

Autoexport bash internal variables

I need to access to some bash internal variables (BASH_LINENO, BASH_SOURCE) from a command invoked by a shell script. The only possible interface between my command and the script are environment ...
0
votes
1answer
192 views

I am having trouble trying to authenticate Google SDK using cygwin

I am trying to install SDK using Cygwin as instructed here https://developers.google.com/cloud/sdk/#Quick_Start after Cygwin is installed I follow the guide and then try to authenticate using the ...
1
vote
2answers
214 views

Pipe output from two commands into one

Is it possible in unix/bash to pipe output from two commands into another? I tried running the following command, which successfully ran both commands, but the first was piped to stdout and the ...
1
vote
1answer
78 views

HandbrakeCLI bash batch script not working.

I am trying to batch encode a bunch of files. Looking over the internet I have found just a couple scripts and none of them worked for me. I started to piece together something and it is close to ...
2
votes
1answer
23 views

Can you delete all users but specified accounts in Ubuntu?

I am trying to find a way to quickly delete all user accounts except for the ones I specify in Ubuntu. Is there a good way of doing this? Perhaps a bash script that could do this function? I ...
1
vote
1answer
25 views

How do I negatively pattern match in a bash script file?

If I type rm main!(.tex|.pdf) into a bash terminal, it will delete all files that start with main but do not end in .tex or .pdf, clearing up various junk files that are strewn around by LaTeX ...
0
votes
1answer
71 views

Creating video with multiple audios and one still image for YouTube

I want to create many videos with multiple audio streams and one single picture. For example I have song1.mp3 song2.mp3 song3.mp3 and one single picture. What I need to do is to create many ...
8
votes
2answers
754 views

Why backslash before asterisk in `find`?

In this command: find . -name \*.pyc -delete Why is a backslash needed before *.pyc ?
1
vote
1answer
29 views

Move Files having No Extension

I have 5 files in a directory log.txt abc.pdf def.ppt 1CC 1DD Now I want to Move files having no extension i.e 1CC and 1DD to a another directory i.e tree. whenever i am manually using command it ...
1
vote
1answer
173 views

How to rename the file name with timestamp of created date by JavaScript, Perl or shell on OSX?

Could you tell me how to get timestamp of created date of file and rename the file name with it by JavaScript, Perl or shell on OSX 10.9.2? Example: Existing: Untitled.txt timestamp is 2014/05/03 ...
0
votes
1answer
24 views

Brace expansion seemingly not working in Bash 3.2.51 on Mac OS X

I have a bunch of LaTeX files on my Desktop: ma 512 hw 11.log, ma 512 hw 11.aux, ma 512 hw 11.tex etc. I want to use brace expansion to print them to the Terminal. E.g., ls *.{log, aux} But ...
0
votes
2answers
40 views

Bash: What does echo xy >| foo do?

The kernel mttr documentation gives this command: echo "base=0xf8000000 size=0x400000 type=write-combining" >| /proc/mtrr While I know what > and | do, I have never seen them in combination. ...
1
vote
2answers
28 views

Copy file structure preserving links

I have a directory full of incremental backups (~20GB) which I need to copy (or move) from one partition to another. This directory contains daily snapshots which have been produced using cp -al to ...
0
votes
1answer
28 views

bash: smart autocomplete based on history?

I once found an amazing bash option, but now I can't remember how to renable it. It extended autocomplete to look at your most recent history. So if you'd previously typed open index.html and then ...
2
votes
1answer
46 views

Record a process's User/System/Real time in Linux/Bash with greater precision

What I am looking for is something along the lines of /usr/bin/time, however, this usually does not have enough precision. I am running a C program (that I can edit and recompile) and I need to ...
0
votes
3answers
48 views

egrep for time in H:MM:SS format

Working on the file an need to grep the line with a time stamp in the H:MM:SS format. I tried the following egrep '[0-9]\:[0-9]\:[0-9]'. Didn't work for me. What am i doing wrong in regex?
8
votes
1answer
128 views

Cannot concatenate videos ffmpeg

I have a bitmap that I would like to concatenate to the front of many videos as a sort of title screen or disclaimer screen. I try to turn it into a video with the same attributes as the rest of the ...
0
votes
1answer
66 views

Change ConEmu directory to working directory with Git bash

I currently have the following to open a git bash instance: -new_console:"%ProgramFiles%\Git\bin\sh.exe" --login -i The above starts the new tab in the home directory. I'd like it to start in ...