Ubuntu :: Unraring En Masse In Bash

Jan 25, 2010

Basically I have a folder of .rar files that I want to unrar. I have been using the following script:for name in *.rar; do unrar x $name; done.The script works excellently, except for one thing: all of the files have the same password, and I have to manually type the password every single time. So what I try is for name in *.rar; do unrar x $name -p<thepassword>; done.

View 5 Replies


ADVERTISEMENT

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

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

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

General :: SSH Connection From BASH Script Stops Further BASH Script Commands

Dec 3, 2010

What happens when the script executes is that the ssh connection works and parks me at the remote hosts's shell login. Therefore, the "firefox" command refuses to execute. I need to know how to make the "ssh" connection occur, stay open, and go into the background so that the rest of the script can execute.If I could also do this with the "firefox" line so that the entire term window could be closed would also be helpful.

View 3 Replies View Related

Programming :: Write A Bash Script That Sources Another Bash Script?

Jan 29, 2011

I am trying to write a bash script that sources another bash script. Essentially, I need a few lines to check to see if a certain variable is set. If not, I set it manually, and then source a scripts with that variable in the path. I wrote a test script to try it, but for some reason the last line does not work. Here is what I wrote:

#!/bin/sh
source ~setupdir/setup.shrc #just a test, this line works
echo ${#SETUP} # prints 0 if setup is not set, which it isn't
if [ ${#SETUP} -eq 0 ]
then
SETUP="~setupdir"
fi
echo $SETUP # prints ~setupdir

[Code]...

View 5 Replies View Related

General :: Bash - HISTSIZE - Readonly Variable -bash - HISTFILESIZE - Readonly Variable

Dec 8, 2009

On one of my servers I see this when I log in. What does this mean and how can I get it to go away? Everything seems to work fine, but none of my other machines give this error.

View 5 Replies View Related

Ubuntu :: Why Can't Use Bash

Aug 27, 2010

why can't I use bash?

Code:$ bash To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details. $ /bin/bash To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details.

View 2 Replies View Related

Ubuntu :: Use Awk In A Bash Script?

Mar 17, 2010

I'm trying to use awk in a bash script. The line that is giving me grief is:

Code:
num=633674
x_orign=3000000.0
x_coordinate=$(awk '{if ($1==num) {print $3}}' file.txt
difference=$(echo $x_origin - $x_coordinate | bc -l)

[Code].....

How can I place both these results into a bash variable? Or into an array, etc?

View 2 Replies View Related

Ubuntu :: Bash Variable And /bin?

Mar 28, 2010

I'm making a script I want to be able to just call (ie, rclick instead of ./rclick) where do I put it?

~/bin?
/bin?
/usr/bin?

Also, how do I pass a variable to the script (rclick 10 will rightclick 10 times) (Found, so simple... $1)Lastly, can I force it to run on CPU2? CPU1 is completley locked up if I run this on it... Or can I make it use less cpu cycles?

View 2 Replies View Related

Ubuntu :: Using Bash To Shutdown?

May 1, 2010

I would like to make a bash script that shuts down. Problem is... How am I supposed to do this when shutdown requires sudo and ultimately requiring me enter my password as a response?

I.e.
#/bin/bash
#Do: shutdown at xx : xx time
shutdown 23:45
#done (yea just one line...)

How could I make sure my password is given to the sudo response without manually entering it ever time?

How could one make this script run automatically i.e. on startup every time.

View 2 Replies View Related

Ubuntu :: How To Boot Into Bash

Jun 9, 2010

My ubuntu system hangs uppon start, think it has to do while my computer ran out of battery when installing updates. Is there way to do a safe boot so I can try to run:

sudo apt-get install --fix-broken

View 5 Replies View Related

Ubuntu :: How To Name A BASH Process

Jun 26, 2010

I am having a problem identifying a BASH script process that I run at startup.When I use "ps -e", I see a few BASH and SH processes running, but I don't know if any of these are my script. Is there a way to give a BASH script a specific name when run that I could see as the process name. That would make it easier to identify and kill when needed.

View 3 Replies View Related

Ubuntu :: Does It Use Bash Or Some Other Shell

Sep 16, 2010

Does it use Bash or some other shell?

View 2 Replies View Related

Debian :: Bash From Ubuntu To 6?

May 8, 2011

I'm in the process of switching from Ubuntu 10.04 to Debian 6.0. The install went pretty well after some tinkering, but I want to replicate my bash environment from Ubuntu to the new Debian system.

I've copied over my /etc/bash.bashrc and my /etc/profile. I renamed my ~/.bashrc, logged out and back in, and expected to have my original shell environment because I would be defaulting to the system-wide settings in /etc.

Instead, the stock Debian environment remains: No completion, only the $ prompt, no up-arrow history, etc. I don't get what it's reading from and why /etc/bash.bashrc isn't being accessed. (Bash completion is installed.)

View 3 Replies View Related

Ubuntu :: Terminal, Bash Have No History?

Feb 15, 2010

terminal i open i have no history; the history is kept only in that terminal and is gone when i exit the terminal.If I count lines:as a user:

Code:
$ wc -l .bash_history
wc: .bash_history: Permission denied

[code]....

View 2 Replies View Related

Ubuntu :: Bash Set Aliases Not Staying?

Feb 23, 2010

If I set an alias in the terminal it stays.

Code:
alias echo="echo whoaoaaoaoaoaoaoa"

But...if I write a bash script with the identical command and execute it...

Code:
./setalias
echo

I get nothing... How do I fix this?

View 9 Replies View Related

Ubuntu Installation :: Add A New Compiler To Be Used In Bash?

Mar 11, 2010

we are using a tool to simulate a basic computer, called TOY now this TOY has its own compiler and linker, which i will need to use in order to use *.asm files in this simulator how do i add the commands "toyasm" and "toylink" to be used in my linux bash? i have the files "toyasm" and "toylink" provided by the lecture's materials, and already managed to copy them into /usr/bin, where i found the "gcc" compile command already (been using that one before) but now i get "permission denied" when i try to use the new ones. what to do when i want to add custom compilers to my system?

View 6 Replies View Related

Ubuntu :: Bash: Permission Denied

Mar 27, 2010

I tried to execute the following command: $ ./eval_online_wiki.ml -db_user aa -db_pass bb -db_name cc It returned as follows: bash: ./eval_online_wiki.ml: Permission denied What does this mean? How to solve the problem? Actually, I was following a README, and it says "$ ./eval_online_wiki -db_user <username> -db_pass <pwd> -db_name <db_name>"

View 2 Replies View Related

Ubuntu :: Embedded Commands In Bash?

Apr 7, 2010

I would like to be able to connect to a machine, list a directory, wait long enough for me to see the results then move on to the next machine.This is failing:

Code:
#!/bin/bash
while read line; do

[code]...

View 3 Replies View Related

Ubuntu :: Possible To Copyright Bash Scripts?

Apr 14, 2010

I have created some bash programs (scripts). Can they be copyrighted, if yes then is it mandatory to use GPL as bash (the interpreter) is GPL'd or they can be under any license, even close source?

View 9 Replies View Related

Ubuntu :: Bash Not Starting Automatically?

Apr 28, 2010

everytime i open a terminal window, all i see is:

$ _

and i have to type bash everytime to get it running. i found a bandaid fix by having it type bash at the "custom command" profile preference... but i still consider the problem to be unsolved, because i still have to manually type 'bash' whenever i log remotely (putty). it seems like something happened, and now bash is not loaded by the terminal by default like it should.

PS: i already tried 'cp /etc/skel/.bashrc ~./bashrc', and it didn't seem to do anything.

I am using Ubuntu 9.10, fairly fresh install. Had one hard reset since I installed it, which could be when the problem started. Also, I was messing a bit with profiles, switching their ID's and adding/deleting them (not sure if that would be the problem).

View 2 Replies View Related

Ubuntu :: No Bash Completion With Sudo?

Apr 29, 2010

Just installed 10.04 64bit and in gnome-terminal i have no bash completion when sudo is used.For example:apt- gives apt-getbut sudo apt- does nothing, i get no suggestions from the terminal.

View 6 Replies View Related







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