Ubuntu :: Bash Script Not Working?

Nov 9, 2010

The first step of my project is to figure out what music files are in my Music folder.

Here is the beginning of my script. If I put the script in the Music folder, it works and generates my 'catalog' file. However, if I put the script in a different directory (say, my Scripts directory), I don't get any errors, but I also get no 'catalog' file.

Code:

#!/bin/bash
##find /usr/src -not ( -name "*,v" -o -name ".*,v" )
find /home/XX/Music -type f -print -name '*.mp3' > catalog

why do I not get my 'catalog' file if I place the script in a different directory?

View 3 Replies


ADVERTISEMENT

General :: Running Bash But Common Bash Commands Not Working?

Jul 17, 2010

below are the details of my system. I have bash as my current shell, some really common commands aren't working.

Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])

Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$

[Code]....

View 13 Replies View Related

Ubuntu :: Bash Color In A Script Not Working?

Mar 6, 2011

This works (meaning it changes color) from CLI...echo -e 'e[1;36m' testCyanBut if I put that same exact line in a script, the result is not colored, and it displays the actual command on screen like this...-e 'e[1;36m' testCyanThe script is obviously executing. Why isn't it interpreting the backslash command in the script?

View 2 Replies View Related

Ubuntu :: Variables In Bash Alises Not Working With 11.04

Jul 26, 2011

I am trying to use the following bash alias:

I've been able to get this working under mac and solaris.

I've also tried not escaping the vars.

Anyone know if this is doable with ubuntu's bash shell? (or any meaningful workaround other than writing a script for this?)

View 2 Replies View Related

Ubuntu :: Latest Kernel Update Bash Not Working?

Nov 24, 2010

I am running Maverick via Wubi. I just completed a Kernel upgrade and when I restart into Ubuntu it just goes to a Bash prompt. I am not sure exactly what version I updated to so I haven't logged a bug report yet.

View 1 Replies View Related

General :: Writing In Bash While It Is Working?

May 6, 2011

When you are performing time consuming operations in bash like installing new software, is it possible to write text that will appear at the prompt when the operation has finished.

E.g

Imagine running:

apt-get install eclipse-platform

Then it will use quite a while to finish while you see the installation log, meanwhile I want to create new folders (workspaces) which Eclipse later will use.

Is this possible without opening a new terminal (or tab)?

View 5 Replies View Related

General :: Scp Is Not Working With Restrict Bash?

Apr 21, 2011

I just wondering if scp working with restrict bash ? It seems like my scp just stuck there while login.

If i use ftp i get 530 login failed..

View 1 Replies View Related

General :: Bash For Loop Not Working?

Apr 21, 2010

I have bash 4.0. I used the following for loop example, but all it outputs is "{1..10} instead of the actual numbers one through ten. why?

Code:
for a in {1..10}
do
echo -n "$a "
done

View 5 Replies View Related

Ubuntu :: Bash Commands' Auto-complete Not Working For Some Apps?

Jan 15, 2010

I've got an annoying problem that 'man' and some other commands do not auto-complete (via TAB). e.g. typing: man rsyn (TAB, TAB, TAB, etc) will not auto-complete to 'man rsync' however, if i 'sudo -s' & then try the above, 'man' auto-completes everytime. (Directories always auto-complete successfully) My ~/.bashrc contains:

Code:

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion

[code]....

View 8 Replies View Related

Ubuntu :: Chroot Not Working: Cannot Run Command `/bin/bash': No Such File Or Directory

Mar 20, 2010

I'm trying to change the root directory to /tmp/somedir using chroot, but even using sudo or su-ing to root I get the message:

Code:

cannot run command `/bin/bash': No such file or directory

I tried copying /bin/bash to /tmp/somedir/, but the same error occurs. What's wrong with my chroot?

View 7 Replies View Related

General :: Error Propagation Not Working In Bash

Mar 14, 2011

when ever some error happens in the functions, they are not propagated and err_out function is not called.I tried #!/bin/bash -E too; that way when there is an error the script exits but what I need is error to be propagated properly to the handler.

View 1 Replies View Related

Software :: Bash Hostname Completion Not Working?

Nov 25, 2009

According to the Bash man pages, Quote: HOSTFILE Contains the name of a file in the same format as /etc/hosts that should be read when the shell needs to complete a hostname. The list of possible hostname completions may be changed while the shell is running; the next time hostname completion is attempted after the value is changed, bash adds the contents of the new file to the existing list. If HOSTFILE is set, but has no value, bash attempts to read /etc/hosts to obtain the list of possible hostname completions. When HOSTFILE is unset, the hostname list is cleared.

Here's the line in my .bashrc where HOSTFILE is set:

Code:

export HOSTFILE="~/.hosts"

I opened a new bash session, created ~/.hosts, filled it with the names of servers that I wanted to expand using tab completion. then typed

Code:

ssh p<tab><tab>

expecting to get a lists of all of the hosts in ~/.hosts starting with 'p'. Bash simply beeped at me twice.

I tried

Code:

$ shopt hostcomplete
hostcomplete on

Code:

ssh bchittenden@p<tab><tab>

same results.

[code].....

View 2 Replies View Related

Programming :: BASH - If Variable -eq String Not Working ?

Jan 24, 2010

Here is the code:

Code:

How ever when I run this script I get the following error

Quote:

I just don't get it, I have racked my brain trying to figure out every combination of how I should write this if statement and I can't get it to work.

View 2 Replies View Related

Programming :: History -c Is Not Working In Bash Script?

Mar 26, 2010

i wrote a script to run over a macintosh system

Quote:

#!/bin/bash
history -c
clear

but the script not doing what i am trying to achieve.

View 1 Replies View Related

Programming :: Working With User Input In Bash

Jun 2, 2009

I've been using python/bash to help myself automate things for a long time, however I am curious. One reason I use python more is because I don't quite know how to work with user input in Bash, such as getting it to ask for input and wait, and then placing that user input into a command.

Here's an example of a script I use from time to time for converting OGG video files into AVI.

How could I write this same script in Bash? Keep in mind I am mostly self taught, so I am by no means an expert programmer.

Code:

View 3 Replies View Related

Debian :: Login Via SSH - Bash Autocomplete Stopped Working

Feb 3, 2011

For some reason my bash autocomplete stopped working. I get the error when I try to cd into a directory, pressing <tab> for autocomplete:
cd A-sh: <( compgen -d -- 'A' ): No such file or directory
Autocomplete works for the root user and for the other user on the machine, just not logged in as this user. The .bashrc file looks fine to me, and I didn't make any changes to it to even cause the bash autocomplete to stop working (as far as I know).

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
What else could cause autcomplete to stop working? I log in via ssh, btw.

View 11 Replies View Related

General :: Echo Newline Character Not Working In Bash?

Mar 11, 2011

I have bash script which has lots of echo statements and also I aliased echo to echo -e both in .bash_profile and .bashrc, so that new lines are printed properly for a statement like echo 'Hello World' the output should be I even tried using shopt -s expand_aliases in the script, I am running my script as bash /scripts/scriptnm.sh; if I run it as . /scripts/scriptnm.sh I am getting the desired output.

View 4 Replies View Related

General :: Removing Subdirectorys And Only Working With Files (Bash Cookbook 5.8)?

Jul 6, 2010

The Cookbook gives us

for FN in $*
do
echo changing %FN
chmod 0750
done

but that changes all. how can I change all files but subdirectorys? I was thinking of something likels -l | grep -v ^d but can't get it to work. I'm still learning about variables and how to use them. thanks in advance for your Patients.

View 2 Replies View Related

Programming :: Bash Regexp String Compare Stopped Working?

Oct 20, 2010

Have a bash script which contains a line like this:

if [[ ${array[${last}]} =~ "screenpc.PRODUCTION.*" ]]

which WORKED as expected in bash 4.0.33 and now fails in 4.1.2

Instrumented the script to print the value of the left-hand side and it is exactly what is expected.

As noted above, this has been working fine until we installed Fedora 13 (kernel 2.6.33), and now it fails.

Tried setting shell 'extglob' to On with same results.

Did something change? Are there other shell/bash options that need to be set?this has the whole installation stopped!

View 10 Replies View Related

General :: Bash History And Keeping Track Of Current Working Directory?

Jun 8, 2010

I would like to keep track of not only what bash commands I used and when, but also where they were issued from, i.e. what was the current working directory when I issued "foobar" on a particular day and time. Can we ask bash history to keep track of working directories too? I have tried to get an idea of this reading the enormous "man bash", but I don't seem to have an answer yet either way.

View 11 Replies View Related

General :: Cd Command Not Working In .cshrc File (bash Shell SUSE)?

May 29, 2011

Just trying to execute cd command in a .cshrc file (bash shell in SUSE Linux) it says."No such file or directory".Do you see any reasons for this

View 3 Replies View Related

Ubuntu :: Terminal Bash / -bash: Ls: Command Not Found

Jun 5, 2011

I got a problem with terminal, since i'm really a noob with terminal i don't know how to fix it.Everytime i type in a command it shows for example:

-bash: ls: command not found

Even the basic commands don't work... just cd <directory> and those things works

View 9 Replies View Related

Programming :: Bash: Printing The Line Number In Bash Script?

Feb 4, 2011

I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.

View 3 Replies View Related

General :: Write A Literal Bash Command In A Bash File?

Nov 29, 2010

I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:

Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END

[code]...

View 6 Replies View Related

Programming :: Bash Ctrl+c Tarp And Bash Read With Timeout?

Jan 24, 2010

simple bash code:

Code:
#!/bin/bash
trap "echo 'you got me'" SIGINT SIGTERM # to trap ctrl+c
echo "Press ctrl+c during 5 sec loop"
for ((i=0;i<5;i++)); do

[Code]...

How come code behaves normally and stops when ctrl+c signal is caught and resumes, but after I use at least one timeout read in the code it looks like, if signal is caught again it doesn't pause the execution but skips the loop. If you remove -t (timeout) option from the read, both loops look the same!

View 10 Replies View Related

Programming :: Reading A Bash Variable In Bash Scripting ?

Nov 26, 2008

I have a config file that contains:

my.config:

Code:

Now in my bash script, I want to get the output /home/user instead of $HOME once read. So far, I have managed to get the $HOME variable but I can't get it to echo the variable. All I get is the output $HOME.

Here is my parse_cmd script:

Code:

View 3 Replies View Related

Programming :: Run Multiple Bash And Php Scripts From A Bash Script?

Jul 25, 2011

I have written quite a few separate bash & scripts and php scripts that up to now I have run from cron jobs. However I have to estimate how long each takes to run, before running the next and so it probably takes much longer than necessary to run them all. They have to run in order.

Now there are so many I am thinking it would be better to have a master bash script that would run one after the other, but I am not sure how to get the master script to wait before starting to run the next script. Is this possible and is there a command that will make the script wait between bash and php scripts , for them to finish, before running the next?

View 5 Replies View Related

Slackware :: Bash - Random Headers When Starting Bash In X?

Jan 13, 2011

I have searched and searched and maybe I don't know how to articulate this issue with out just posting the problem I'm having. Every time I bring up a terminal window I get the following "Header"

declare -x COLORTERM="gnome-terminal"
declare -x CPLUS_INCLUDE_PATH="/usr/lib64/qt/include"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-xSFd6zqrYQ,guid=dc5e07974559da016842742900000090"
declare -x DISPLAY=":0.0"

[Code]...

To be honest I cheated and used the .bashrc / .profile files from Ubuntu and all was working fine for a while now and it seems something changed to cause this... any ideas on why I am getting this? I checked my .bashrc and my /etc/profile and it doesn't look like anything is amiss..

View 3 Replies View Related

Programming :: Bash: Get Filename And Extension Using Bash?

Jan 9, 2010

I would like to get the filename (without extension) and the extension separately. The best solution I found so far is:

Let FILE="thefilenameofsomefilesfor_instance.txt"

Code:

NAME=`echo "$FILE" | cut -d'.' -f1`
EXTENSION=`echo "$FILE" | cut -d'.' -f2`

I think it would be better to count the len and remove 3 chars to right to get the extension, but it can be macintosh filenames with have 4 chars for extensions.

View 5 Replies View Related

Slackware :: If Close Terminal Ran Bash Script Inside / Bash Script Stops

Apr 28, 2011

I've noticed something, and hoped there was a work around.when I write a simple bash script, and run it, if I close the terminal i ran the bash script inside, the bash script stops. What are the solutions for this? Basically I want to run my bash script and close the terminal, keep the bash script running.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved