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


ADVERTISEMENT

Debian :: Bash Consumes 100% Cpu

Sep 21, 2015

I have a virtual server with debian and since last Friday a problem. The server is running normally. All sites hosted show no problems. But If I logon via ssh is the CPU usage of all cores goes to 100%. A simple cd (change dir) then takes about 90 seconds. using top or htop bash is the top scorer. Unfortunately I have absolutely no approach what I have to change here or where the misconduct comes from.

View 2 Replies View Related

Debian :: Set New User To Use Bash?

Mar 16, 2011

when i created new user with # useradd -m newuser and logged in as newuser, i cannot have the autocompletion that the first user have.Why? How do i set newuser to use bash and the same for all other user?

View 5 Replies View Related

Debian :: Bash Script As A Program?

May 21, 2011

Is there a way to have a bash script run as a program so you can start it like how you would run apt-get?

View 2 Replies View Related

Debian :: Image Manipulation In BASH?

Nov 7, 2010

I would like the ability to manipulate a jpg (bmp, gif and raw would be nice as well) while in BASH. To be more specific, I would like to either add a water mark or a little section as a footer on the bottom of an image.

I will be using this as part of a shell script to alter files in a directory on my webserver.

View 2 Replies View Related

Debian :: Sed With Bash Variable In Rules File

Jun 6, 2015

How can we do a file replacing string on debian/rules file using sed and bash variable ? I don't seem to be able to do so. I have tried below under the install section with arch dependent amd64, as far as I know all the bash commands are allowed to be executed in debian/rules file.

I have tried this :

Code: Select all
debian/rules file
ipaddr=`<long command to find ipaddr>`
myVar=`hostname`
sed -i -e 's/somestring/'$myVar'/g' $(configs)*
sed -i -e "s/somestring/$myVar/g" $(configs)*

[Code]...

Nothing works. Sed works but the hostname replacement doesn't work.

View 13 Replies View Related

Debian :: Bash Script Based On Time Of Day

Mar 25, 2016

I'm trying to get a bash script to do different things based on the time of day, but at least once a day the test fails:

Code: Select allNOW=$(date +%k%M)
if [[ "$NOW" -ge 1000 ]] && [[ "$NOW" -le 2200 ]];then
        alarm lon
else
        alarm loff
fi

This is the error, and line 59 is the second quoted above:

Code: Select all/home/electrolux/bin/ts.sh: line 59: [[: 059: value too great for base (error token is "059")

The script is run every minute, and this error only occurs at 12:59AM, or 00:59.

I presume the problem is either $NOW is being set to 059, or the testing is seeing 0059 as 059. I think the latter, because for the rest of midnight 'til 00:58 the script works. And with some Googling it seems that the leading 0 is making test treat the number as octal... is there a way to tell it it is decimal?

Perhaps this is just some poor time-testing code? Looking at it I don't think it will cope with set time period that crosses midnight..... there's probably just a command to do what I want, isn't there? I know I could have two different scripts cron'd for the different time periods, but it would be much more preferable to be just the one.

View 4 Replies View Related

Debian :: Find >> Remove Strings With Bash?

Aug 22, 2010

i'm trying all the time to use this (find,sed gnu,..etc) scrip to find and remove this string in all files *.php in wwwbackup/ directory. the script work without any error, but doesn't remove any thing!?

find /home/usr/wwwbackups/ -type f -name *.php -print0| xargs -0 sed 's#echo "<iframe src="http://internetcountercheck.com/?click=2255046" width=1 height=1 style="visibility:hidden;position:absolute"></iframe>";##g' -i

how can i become this script working?

View 8 Replies View Related

Debian :: Creating A Bash-shell Script

Dec 1, 2015

how to do in Debian

1. am required to create a bash-shell script called terminator that terminates all processes of a name given to the shell script as an argument. Make sure the terminator shell script will not take any crucial file system services as arguments.

2. Show how you would configure an Ethernet card by reapplying your existing IP and network mask

3. Install a workable nfs file sharing system between your system and a remote system, using optimum values for resize and wsize.To demonstrate send a 512Mb block of random data between client and server using the dd command.Write down the relevant steps and procedures

View 6 Replies View Related

Debian Programming :: Bash Scripting For Jessie

Aug 25, 2015

You are probably using systemd (check it with ps --pid 1) and therefore /etc/init.d isn't considered for autostart. Here can you find some information about systemd and autostart [1]. As far as I know systemd isn't intended to start applications with systemd. I recommend you to use the autostart feature of your window manager or desktop environment or at least the .xinitrc.

[URL] ....

View 7 Replies View Related

Debian :: Control Lynx By Bash Script

Sep 10, 2010

I had tried to control lynx by bash script. I can use bash script to let lynx open an url. After that, I can't do anymore. I don't understand how to move the cursor or fill some textbox in the webpage opened by linx in bash script.

View 3 Replies View Related

Debian :: Bash / Mail / Command Not Found

Dec 27, 2008

I did install a brand new debian etch on my server, update and upgrade has been done.I did installed a postfix and couple of tools ( like courier-* ).But when i want to try to sent a mail with mail command, it says command not found.I did use the method on the bottom of this thread succesfully, but any idea for this tool to be back on my server ?Did i uninstall it when installing a package ?

View 1 Replies View Related

Software :: Console / Bash Configuration In Debian?

Nov 13, 2010

I'm trying Debian again just for fun after using Slackware for years. When I "su -" on Konsole in Debian I get this for my prompt:
Code:
darksaurian@darkswamp:~$ su -
Password:
darkswamp:~#
darkswamp is my hostname that I made up when I installed. On Slackware I'm used to it saying:
root@darkswamp
or something like that.
I'm starting Konsole the same way on both:
konsole -e $SHELL -l
I kind of wish it still said "root" just because I'm used to it.

View 5 Replies View Related

Debian :: BASH Scripting - How To Use Variables With Filename Spaces

Jun 25, 2015

I am trying to create scripts to move files over from one directory to an ftp server and there is this one file with spaces that bash is see each word as being a file, here is the variable i am trying to use:

Code: Select allLOCL = '/mnt/cifs/"File name with spaces"/'
cd  $LOCL
ls -l

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

Debian Installation :: Different Bash Shell Behaviour In Squeeze?

Feb 11, 2011

I know I was asked about wanting to change/upgrade my shell during the upgrade from Lenny to Squeeze, but I can't remember what it said, and I can't find any documentation about it online. But did something change to bash? Is this documented somehwere?Most notably I see progress messages on one line, overwriting eachother (for instance during an aptitude safe-upgrade).

View 7 Replies View Related

Debian :: Drag & Drop File On Bash Script?

Jul 29, 2011

On Windows, I can drop file on batch script file, then dropped file is accepted as script parameter and script is automatically executed. Trying the same in Nautilus it seems like not possible.Is there some other way of using this approach in Debian?I hope it's clear what I'm after - I don't want to write Nautilus scripts as workaround and want to avoid: - opening terminal - cd to bash script - type script name andmeter file then executeinstead I would like already mentioned, drop filename expected as parameter to bash script, and then script to execute automatically.

View 3 Replies View Related

Debian Programming :: Running Programs In Parallel In Bash

Jul 22, 2014

I am trying to replicate what is happening on this page under the tcsh shell, but using the bash shell found in Wheezy. Here is the page I am referring to:[URL] The command I am trying to replicate is on page 6 under figure 2.4. The command is "prompt> ./mem &; ./mem &".

I would like to run the same program twice, concurrently, but do not know how. Note that I am not trying to use a bash script, but rather by simply using syntax on the command line.

View 4 Replies View Related

Debian Programming :: BASH Script For Battery Alert (Low)

May 19, 2010

I'm trying to make my own BASH script for alerting low battery. It's working well, but it simply show messages, whether the state is 'Discharging' or 'Charging'.

Here is the code:

Code: Select all#!/bin/bash

#checking sleep time
SLEEP_TIME="60"

#actions
ACTION="xfce4-terminal -x sudo shutdown -h now"

[Code] ....

View 6 Replies View Related

Debian Programming :: Yesterday Date In Bash Script

Jun 22, 2011

I have used "FILENAME="`TZ=$TZ+24 date +%y%m%d`" in a bash script that run in openbsd. What my script does is to changes a file name to "yesterdays date". I tried to use it in a script that runs in debian but it doesnt work. Is there any other command that i can use in debian?

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

Debian :: Determine File Type On Bash - Command Not Found

May 10, 2015

I cannot find a bash command: "file" !

It say "-bash: file: command not found"

"file" is used to determine file type on a bash right ? is there a package i have to install ? deprecated ?

I use debian wheezy distro

View 2 Replies View Related

Debian :: How To Avoid Closing Console - Bash Script - Window

Jul 30, 2011

I have a bash script and I'm dropping a file on script launcher shortcut. Everything seems fine, only that after executing the script console window closes, so I can't see if some messages were produced during execution.

As I just recently switched from Windows, this kind of problem is solved there by adding 'pause' command in batch script, on which user has to press key and script will then continue (finish) or by launching through 'cmd /k' which makes console window persistent.

Googling I found about 'sleep' command and more appropriate for me 'read' command, so I did this:

Unfortunately, I can't see any effect of 'read' command as console windows again terminates after execution. Execution is successful BTW. So what's the catch?

View 9 Replies View Related

Debian Configuration :: Change Prompt Color In Bash Shell?

Jan 13, 2010

I am getting more and more comfortable working with the shell, thus I would like to change its prompt color to my liking, as it will be easier for me to distinguish commands vs. outputs.

I've read a couple of instructions of how to change the .bashrc file and am familiar with what the codes in PS1 mean. Except, this file can be intimidating to newbie eyes.

Where exactly on the file is it that I need to make the change?

Here is what I am trying to do. I would like my prompt to like exactly like the prompt I use in Backtrack - which consist in two different colors, one for the host and another for the pwd. Here is what the Backtrack .bashrc file looks like:

# /etc/profile: This file contains system-wide defaults used by
# all Bourne (and related) shells.
# Set the values for some environment variables:
export MINICOM="-c on"
export MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man:/usr/local/share/man:/usr/bin/man:/usr/share/man
export HOSTNAME="`cat /etc/HOSTNAME`"

[Code]....

I also read that in order to have the same results when I log in as root, I will have to copy the modified .bashrc file into /root

View 8 Replies View Related

Debian Programming :: Assign Variable In Bash When Stdout Is Updated

Jan 17, 2014

I am writing a script that calls a program which writes a lot of lines to stdout continuosly. If the last line in stdout has some regex, THEN, certain variables are updated. My problem is that I don't know how to do that.

A simplified example would be (it's not my exact case, but it I write it here to clarify): suppose I issue a ping command (which writes output to stdout continuously). Every time that the response time is t=0.025 ms, THEN, VARIABLE1=(column1 of that line) and VARIABLE2=(column2 of that line).

I think the following code would work in awk (however, I want the variables in bash and I don't know how to export them)

Code: Select allping localhost |awk '{ if ( $8 == "time=0.025" ) var1=$1 var2=$2}'

In the previous code, awk analyzes each line of the output of the ping command as soon as it is created, so the variables $var1, $var2, ... are updated at the appropriate time. But I need the "real-time" updated values of $var1, $var2 in bash, for later use in the script.

View 7 Replies View Related

Debian Programming :: How To Do Code Bash Script To Run Su And Enter Password

Sep 15, 2014

Whats the bash script for like, how synaptic package manager runs ..

When you run synaptic it ask for root password ..

How do I do this in bash script?

View 5 Replies View Related

Debian Programming :: Starting Chromium In Kiosk Mode From Bash

Dec 14, 2014

I'm trying to start Chrome in kiosk mode from a systemd service on boot. The 'webserver app' named 'xx' in the samples launches but chromium never comes up.

xx.service :

Code: Select all[Unit]
Description=xx Service
After=syslog.target

[Service]
Environment="DISPLAY=:0.0"
Type=forking
WorkingDirectory=/usr/bin/xx/
ExecStart=/usr/bin/xx/xx
ExecStartPost=/usr/local/xx/chromium.sh
Restart=on-abort

[Install]
WantedBy=multi-user.target

chromium.sh

Code: Select allchromium-browser --kiosk http://xx-01.local:8081 &

View 1 Replies View Related

Debian Installation :: Error Message - Bash / Visudo Command Not Found

May 24, 2015

I have just installed Debian 8 with Gnome desktop and trying to add my username to sudoers list.

When I open terminal and enter visudo I get the following error message...

Code: Select allfracmo2000@debian:~$ su
Password:
root@debian:/home/fracmo2000# visudo
bash: visudo: command not found
root@debian:/home/fracmo2000#

Although I am quite new to debian, I have done this successfully in the past so not sure why this is happening?

View 7 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







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