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

learn more… | top users | synonyms

0
votes
1answer
346 views

how to check for duplicates and rename file if there are any while copying them from another source

It's a script in bash, it copies files from one directory into another but there may be duplicates in a sub-directory. So while copying, it should recognize if a another file has the same name and if ...
0
votes
1answer
642 views

Recursively copy and rename to replace spaces with underscore

I have a directory with 400 sub-directories each containing several hundred files many with filenames that contain spaces. I need to copy all of the files with spaces in the filenames, resulting two ...
0
votes
1answer
235 views

crontab a bash script that is copying certain files

First I would like to say that I am terrible with scripting so this has been a true challenge for me. Any input would be great! I would like to automate an sftp transfer every 24h. If I am lucky in ...
0
votes
1answer
717 views

Start script on network connect

I am trying to get a GNU/Linux Bash script to run as soon as a network connection is established on my Raspberry Pi. I tried following the instructions on several pages: I have tried adding my script ...
0
votes
1answer
295 views

Scripting with rsync, pulling more than the return status

I have a script to backup my images and alert me to the status of the script which gets run every 5 minutes. However, I want to figure out how to identify when rsync was successful, but didn't do ...
0
votes
1answer
458 views

How to configure in crontab with condition statement for checks

We like to monitor the NAS storage mounted on a Linux box. We only like to be notified via mail when the usage exceeds a certain number, say 80. We have only seen in Linux books where most of them ...
0
votes
1answer
252 views

UNIX script to LPAD update query in cat file

I want script which will open the text file data and write update query to those file and save in SQL file which will get executed through cron. I have prepared command but its writing the update ...
0
votes
1answer
302 views

Debian ssh user TAB behaviour changed - how to revert it?

I have created new user with: useradd u passwd u When logged as u via PuTTy the TAB key behaviour is changed: autofill dir/filenames and commands not working the tab is placed instaed (4 spaces) ...
0
votes
1answer
86 views

trying to install Astromenace on my linux mint 14 cinnamon pc

so i am following this tutorial as it is the only one i can find and any that i can find are the same as this one: http://linuxg.net/games-on-linux-how-to-install-astromenace-on-ubuntu-and-fedora/ ...
0
votes
1answer
81 views

bash terminal: can the find and make duplicate text be extended globally--Apple?

From Finding and removing duplicate files in osx with a script, can this be extended to find duplicates across the whole hard drive instead of per folder? I know there are duplicates but they aren't ...
0
votes
1answer
449 views

Type an EOF without a line break

I have a little command that I use to copy/paste files around that involves pasting the base64-encoded tar archive into stdin, but the base64 utility keeps giving me and error message about my input ...
0
votes
1answer
62 views

What would an update mechanism look like in bash

I have to update a script compilation from time to time but I haven't any idea how to start a version check script in bash. I've got a version file with 3 vars: version=0, subversion=0 and ...
0
votes
1answer
344 views

howto change screen hardstatus dynamically with format, from shell?

howto change screen hardstatus dynamically with format, from shell ? I successfully configured screen using 256 colors and tabs and so on, here is my .screenrc : http://pastebin.com/g8XbMWBH I use ...
0
votes
1answer
70 views

Bash script: allow change of “environment/identity”

I came across this problem now several times and I would like to find a way to automate/script this things that involves a change of identity or environment (I am not sure how to call that precisely). ...
0
votes
1answer
149 views

profiling file reading speed via /dev/null?

I am profiling the speed at which a certain Linux program reads a certain input file using different amount of threads by doing this: time ~/src/myprogram -t $t inputfile 1>/dev/null ...
0
votes
1answer
88 views

rm the current directory you are in and issues surrounding it

If I cd to a directory, is there a quick way to delete the directory I am in and move to the top directory? Usually I cd to a directory, ls it and then cd .. then delete the folder. I want to be able ...
0
votes
1answer
131 views

Do all the scripts that are run in “rc.local” display results on the terminal or do they just run in the background?

Do all the scripts that are run in rc.local display results on the terminal or do they just run in the background? What if I want the scripts to run before the startup and wait for the user input to ...
0
votes
1answer
35 views

Partial ignore case tab completion

First, let me go through a specific case and then explain the general case. Suppose I have two directories A and B. The contents of A are: foo Bar The contents of B are foobar Foobar I would ...
0
votes
1answer
268 views

sfdisk partition size in bytes

Kind of homework related so further reading is always appreciated! Using sfdisk I have to specify the size of certain partitions in bytes. For this I used sfdisk -lub /dev/sdd Which lists the ...
0
votes
1answer
810 views

how do I preserve export PATH?

How can I make ssh admin@nas command work if command is in /opt/bin? On my QNAP NAS File /root/.ssh/rc: echo "old path is $PATH" export PATH=/opt/bin:/opt/sbin:$PATH echo "new path is $PATH" on my ...
0
votes
1answer
72 views

How to make an alias and work in sh for all users (not in bash)?

My question maybe is silly, but how can I make an alias so as to work in sh for all users? I know that I can put an alias, let say this one: alias ls='ls -l' in /etc/bash.bashrc so as to work in ...
0
votes
1answer
205 views

Citrix-XenApp Error (SSL-Server 61) with FF on OpenSuse 12.2: how to bypass?

good day dear Superuser, I am trying to utilize Citrix XenApp to remotely access my work userid and applications from home. I can login and see my virtual desktop/applications, but when I try to run ...
0
votes
1answer
134 views

How to configure secureCRT to remove content display after quit from vim

Open a ssh or telnet connection in secureCRT 6.0 or 7.0, when "vim xxx.txt", after quit vim by ":q", the content of xxx.txt will still be visible in screen. But in putty, the same operation, content ...
0
votes
1answer
176 views

how to compare negative floating points in bash

We tested our script and it fails on negative floating points comparison in bash. What are we doing wrong ? $F1=10000000000 $F2=300 FLP=$(bc <<< "scale=5; ($F2 - $F1)/$F2 * 100") if [ $FLP ...
0
votes
1answer
67 views

Is it possible to make the environment ignore $http_proxy env variable for certain urls?

In Firefox, I can set a proxy for all URLs except certain domains. Is it possible to do the same with the http_proxy environmental variable? That is, could I set another variable to exclude certain ...
0
votes
1answer
163 views

Get Directory/file structure without payload

I need to recursively retreive the file/directory structure of an FTP server, getting only file names (without payload). Can you help me how to do this (curl, wget, ...)? The result should be the ...
0
votes
1answer
123 views

Bash script is printing wrong characters in my variable

I'm trying out the following thing in my terminal: spark 0 76 100 | awk '{print substr($0,4,3)}' outputs: ▆ If I do: GRAPH=$(spark 0 25 100 | awk '{print substr($0,4,3)}') printf "%s" $GRAPH ...
0
votes
1answer
194 views

Virtualbox command line

How do I start Virtualbox from the command line and start a Ruby script on the guest and after the script is done close the guest? What could be easiest way to do this?
0
votes
1answer
58 views

gnu screen command that stops running then switching to another tab

I use GNU screen to keep a bunch of tabs open in my terminal session, and I would like to have a bash command, watch -n 1 ps aux | grep something, that runs when I am looking at that screen tab, but ...
0
votes
1answer
315 views

Combining multiple data files with header while also adding a data column

I have multiple tab delimited data files that are separated by month in the format jan06.txt, feb06.txt, ..., dec07.txt. Within each file, it looks something like: Header1 Header2 Header3 ... Data1 ...
0
votes
1answer
172 views

Passing User's aliases to root while doing “sudo su”

Is it possible? I could make an alias to sudo su -;source .bashrc but it seems like source .bashrc is executed in the earlier shell and not in root's sheel (Why?)
0
votes
1answer
1k views

Bash: changing font size

This will change the font to yellow: echo -e "\E[1;33m" How exactly can I make it bold and increase the font size, whilst keeping the yellowness?
0
votes
1answer
650 views

Running tcpdump on remote machine with no tty using ssh

I'm trying to start tcpdump on several remote machines to perform some network analysis with a script, but I'm failing to run it correctly. The command I would like to use is: ssh user@host ...
0
votes
1answer
74 views

Convert with audacity from bash

I have multiple .wav files (numbered from 1) which I want to convert them to .mp3. audacity can do that with opening a file and exporting using it's GUI. Is there a way that I do this with a bash ...
0
votes
1answer
223 views

Does bash come with knoppix 7 and if not is it hard to install?

Does bash come with knoppix 7 and if not is it hard to install? I am just learning linux and it seems everyone is suggesting to use bash to learn the command line stuff, but I can't seem to find ...
0
votes
1answer
132 views

How to use faketime at bash?

Have a problem with command faketime. Trying to use it, but always get an error: faketime -t "2000-01-01 01:00:00" /usr/bin/faketime: 102: exec: 2000-01-01 01:00:00: not found I have Ubuntu 12.04
0
votes
1answer
26 views

Switcher bash script

I want an executable script that changes screen configuration from 1 to 2 or from 2 to 1. I would need a boolean or a variable where the state is saved. It's that possible? Otherwise, how can I check ...
0
votes
1answer
108 views

Problems with rsh

I have problems calling a remote command by different users on different machines. This remote command shall be executed on one single machine and the rsh-session shall be terminated immediately after ...
0
votes
1answer
30 views

Is there a limit on how many entries the 'Control R' bash shortcut searches?

I have increased my bash history limit to 10000 and I see that my bash history has grown to approximately 6000 entries. However when I try to search my history using 'Ctrl R', it searches only a ...
0
votes
1answer
1k views

Open a terminal window & run command, then close the terminal window if command completed successfully?

I'm trying to write a script to do the following: Open a terminal window which runs a long running command (Ideally) move the terminal window to the top left corner of the screen using xdotool Close ...
0
votes
1answer
94 views

Why is Bash not allowing me to enter input at prompts?

For some reason, my Macbook bash terminal is not allowing me to enter "y" from a prompt. I'm not really sure how to describe this, but you can see the action below. $ sudo pip uninstall django ...
0
votes
1answer
70 views

Find out information about installed hard- and software using the terminal without admin rights

I have access to a remote server, to which I login via ssh. I don't have admin rights, but I like to find out as much as possible about the machine, among other things to see If I get what I pay for. ...
0
votes
1answer
147 views

linux find command issue

I have a shell script which was written for Mac OSX and now ported to a linux machine. I don't have access to a linux machine currently( I will be setting up a virtual machine soon) Some statements in ...
0
votes
1answer
141 views

Cronjob using the mail function

When I run this mail command from the terminal, there's no problems: mail -s "Test Mail" user@example.com < home/user/example.txt When I add it to a bash script that mainly does this, there's no ...
0
votes
1answer
147 views

Get volume-name from mounted volume as shown in finder

I'm mounting an iso-file. Finder shows the name as "This Product" but the folder-name is /Volumes/this_product_" or could be something else. How can I retrieve the name as shown in the Finder?
0
votes
1answer
72 views

Preserving name when bulk unzipping files?

Sorry this question is trivial, but I couldn't get it to work: I have a folder full of .zip files, each .zip file contains exactly one .xml file. The zip files have sensible names like a.zip etc., ...
0
votes
1answer
487 views

How do you display hostname in tabs of console2?

Is there a way to display the hostname as name of a tab in Console2? If I use cygwin and ssh to a remote host, I would like the tab name to reflect the remote hostname.
0
votes
1answer
381 views

Run a command in a tty and send/receive data from it in bash?

I have a program that requires a tty to work. How do I run this program in a separate tty to my shell and then interact with it? (by writing to the interactive stdin, reading from stdout)?
0
votes
1answer
237 views

How do I prevent Bochs translation of keycodes?

My native keyboard layout is "dk" (Danish). I am running Tiny Core Linux in a virtual machine (Bochs). The virtual machine is booting the bootloader where I have the possibility of giving the ...
0
votes
1answer
75 views

Segmentation fault when running bib2x

I'm working on an unfamiliar machine and I am trying to get a program called bib2x to work. Unfortunately, when I run the program, I keep getting a segmentation fault. My (limited) experience and ...