Search Results

Search found 6392 results on 256 pages for 'bash history'.

Page 4/256 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C code - ls system command not showing bash colors

    - by m0atz
    I've just been fooling around with some code in C, an example of a really basic program is as follows which just, obviously, lists the directories using the ls system command. #include <stdio.h> int main (void) { system("ls -l -d */"); printf("I've just listed the directories :-)\n"); return 0; } This runs fine, but it shows the ls output in monochrome, whereas Bash would output the list using colors for the directories (or files if I included files). How can I make my C code use the bash colors? Thanks

    Read the article

  • Creating A Simple Bash Script With Multiple Commands

    - by unorthodox grammar
    Trying to create a bash script that opens gnome-terminal, and then runs ls to display the contents of a directory, but it just opens gnome-terminal. I will be creating some other scripts that also use multiple commands. My script: #!/bin/bash gnome-terminal ls -a /examplefolder EDIT: To clarify what I'm trying to achieve. I'm trying to create a script that will open gnome-terminal, list the contents of /examplefolder, and then be ready for regular terminal usage. Is this possible, or am I barking up the wrong tree?

    Read the article

  • Dynamic case statement in bash

    - by infra.user
    Hi folks, I'm trying to figure out how to create a dynamic case statement in a bash script. For example, let's say I have the output of an awk statement with the following contents red green blue In this scenario, the output can change at any time. I'm trying to then execute different logic if a value is included in this awk output. So if the data above is in $list, then I'd conceptually like to do something like: case "${my_var}" in $list) ..... something_else) ..... esac I'm trying to use this to build a dynamic custom tab completion function (see http://www.debian-administration.org/article/An_introduction_to_bash_completion_part_2 for some background). Any ideas? Thanks.

    Read the article

  • fixed width bash prompt

    - by seaofclouds
    I'd like to set my bash prompt to a fixed width, and make up the difference in space before the $, so whether long or short, my prompt remains the same width: [name@host] ~/Directory/Dir...Another/LastDir $ [name@host] ~/Directory(branch) $ Currently, in a short directory path my prompt looks something like this: [name@host] ~/Directory(branch) $ a deeper directory path looks like this: [name@host] ~/Directory/Dir...Another/LastDir $ You can see I've truncated the PWD in the middle so I can see where the path begins, and where it ends. I'd like to make up the difference before the $. Here is my current prompt: # keep working directory to 30 chars, center tuncated prompt_pwd() { local pwd_symbol="..." local pwd_length=30 newPWD="${PWD/#$HOME/~}" [ ${#newPWD} -gt ${pwd_length} ] && newPWD=${newPWD:0:12}${pwd_symbol}${newPWD:${#newPWD}-15} } # set prompt prompt_color() { PROMPT_COMMAND='prompt_pwd;history -a;title_git' PS1="${WHITEONMAGENTA}[\u@\h]${MAGENTA} \w\$(parse_git_branch) ${MAGENTABOLD}\$${PS_CLEAR} " PS1=${PS1//\\w/\$\{newPWD\}} PS2="${WHITEONTEAL}>${PS_CLEAR} " } In my search, I found A Prompt the Width of Your Term which does do some fill, but couldn't get it working for this particular prompt.

    Read the article

  • What steps put my bash prompt commands into vim and then back again to bash to execute?

    - by xtian
    I've enabled VIM style editing of bash commands at the bash prompt as default bash setting. On a few occasions I've accidentally opened a blank vim file with some complex bash command I was writing. Awesome. How do I get the newly written line in vim back into bash? I found another post where the author had the opposite trouble--or so it seems. What steps put my bash prompt commands into vim and then back again to bash to execute?

    Read the article

  • The Making of Arduino [Geek History]

    - by Jason Fitzpatrick
    The open-source Arduino board is the heart of thousands of different DIY projects–it would be easy to think that the Arduino has always been around. The ubiquitous little hobby board, however, is but a scant six years old. At technology blog IEEESpectrum they delve into the history of the Arduino board and its quiet origins in a small Italian town. Here’s an excerpt from their lengthy write up about the the origin and history of the beloved Arduino: Arduino is a low-cost microcontroller board that lets even a novice do really amazing things. You can connect an Arduino to all kinds of sensors, lights, motors, and other devices and use easy-to-learn software to program how your creation will behave. You can build an interactive display or a mobile robot and then share your design with the world by posting it on the Net. Released in 2005 as a modest tool for Banzi’s students at the Interaction Design Institute Ivrea (IDII), Arduino has spawned an international do-it-yourself revolution in electronics. You can buy an Arduino board for just about US $30 or build your own from scratch: All hardware schematics and source code are available for free under public licenses. As a result, Arduino has become the most influential open-source hardware movement of its time. The little board is now the go-to gear for artists, hobbyists, students, and anyone with a gadgetry dream. More than 250 000 Arduino boards have been sold around the world—and that doesn’t include the reams of clones. “It made it possible for people do things they wouldn’t have done otherwise,” says David A. Mellis, who was a student at IDII before pursuing graduate work at the MIT Media Lab and is the lead software developer of Arduino. HTG Explains: Understanding Routers, Switches, and Network Hardware How to Use Offline Files in Windows to Cache Your Networked Files Offline How to See What Web Sites Your Computer is Secretly Connecting To

    Read the article

  • Remove a line from a csv file bash, sed, bash

    - by S1syphus
    I'm looking for a way to remove lines within multiple csv files, in bash using sed, awk or anything appropriate where the file ends in 0. So there are multiple csv files, their format is: EXAMPLEfoo,60,6 EXAMPLEbar,30,10 EXAMPLElong,60,0 EXAMPLEcon,120,6 EXAMPLEdev,60,0 EXAMPLErandom,30,6 So the file will be amended to: EXAMPLEfoo,60,6 EXAMPLEbar,30,10 EXAMPLEcon,120,6 EXAMPLErandom,30,6 A problem which I can see arising is distinguishing between double digits that end in zero and 0 itself. So any ideas?

    Read the article

  • Bash script not adding variables to session

    - by travega
    I have a bash script that I have added as a startup application. It does a bunch of exports and alias assignment. #! /bin/bash alias devhm='cd ${DEV_HOME}; ll'; alias wlhm='cd ${WL_HOME}; ll'; alias dirch='watch --interval=1 "ls -la"'; alias vols='watch --interval=1 "df -h"'; alias svn-update='svn update --depth infinity ./*'; alias mci="~/mci.sh"; alias vncserver="vncserver -geometry 1680x1050"; alias ..="cd .."; alias hist="history | grep "; export PROXY_HOST=proxy.my.setup; export PROXY_PORT=3128; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH/usr/lib/oracle/12.1/client64/lib; export ORACLE_HOME=/usr/lib/oracle/12.1/client64; export TNS_ADMIN=${ORACLE_HOME}/network/admin; echo "DONE!"; But none of these values are available in my terminal sessions anymore. Even when I run the script straight into the terminal like so: ./setup.sh I see the "DONE!" prompt printed but no aliases or env variables are set. If I copy and paste the contents of the file into the terminal the aliases and env variables are set. I have tried adding a line to execute the script from .bashrc also but still no aliases or env variables set. Any ideas what might be going on here? Also could anyone suggest a better way to have these env variables/aliases added to every terminal session?

    Read the article

  • Script Bash and History Unix

    - by user1107078
    i just start to use Script bash on UNIX and i didnt find a solution to write the first command in the history which start , for example , with ls. If i write in the shell history !ls it works but when i'm going to create a script it wont work. This is my example code #!/bin/bash set -o | grep history set -o history #echo "HISTFILE is $HISTFILE" #history "!ls"; #history #!ls history #it works Another Question why echo "HISTFILE is $HISTFILE" print me only HISTFILE is ?? Thanks

    Read the article

  • A Brief History of Video Games [Video]

    - by Asian Angel
    Are you ready to take a trip down nostalgia lane? This compilation of video game footage provides a brief but interesting look at some of our favorite games over the years and how much the look and feel of them has changed. A Brief History of Video Games [via Neatorama] HTG Explains: What Is RSS and How Can I Benefit From Using It? HTG Explains: Why You Only Have to Wipe a Disk Once to Erase It HTG Explains: Learn How Websites Are Tracking You Online

    Read the article

  • This Week in Geek History: Gmail Goes Public, Deep Blue Wins at Chess, and the Birth of Thomas Edison

    - by Jason Fitzpatrick
    Every week we bring you a snapshot of the week in Geek History. This week we’re taking a peek at the public release of Gmail, the first time a computer won against a chess champion, and the birth of prolific inventor Thomas Edison. Gmail Goes Public It’s hard to believe that Gmail has only been around for seven years and that for the first three years of its life it was invite only. In 2007 Gmail dropped the invite only requirement (although they would hold onto the “beta” tag for another two years) and opened its doors for anyone to grab a username @gmail. For what seemed like an entire epoch in internet history Gmail had the slickest web-based email around with constant innovations and features rolling out from Gmail Labs. Only in the last year or so have major overhauls at competitors like Hotmail and Yahoo! Mail brought other services up to speed. Can’t stand reading a Week in Geek History entry without a random fact? Here you go: gmail.com was originally owned by the Garfield franchise and ran a service that delivered Garfield comics to your email inbox. No, we’re not kidding. Deep Blue Proves Itself a Chess Master Deep Blue was a super computer constructed by IBM with the sole purpose of winning chess matches. In 2011 with the all seeing eye of Google and the amazing computational abilities of engines like Wolfram Alpha we simply take powerful computers immersed in our daily lives for granted. The 1996 match against reigning world chest champion Garry Kasparov where in Deep Blue held its own, but ultimately lost, in a  4-2 match shook a lot of people up. What did it mean if something that was considered such an elegant and quintessentially human endeavor such as chess was so easy for a machine? A series of upgrades helped Deep Blue outright win a match against Kasparov in 1997 (seen in the photo above). After the win Deep Blue was retired and disassembled. Parts of Deep Blue are housed in the National Museum of History and the Computer History Museum. Birth of Thomas Edison Thomas Alva Edison was one of the most prolific inventors in history and holds an astounding 1,093 US Patents. He is responsible for outright inventing or greatly refining major innovations in the history of world culture including the phonograph, the movie camera, the carbon microphone used in nearly every telephone well into the 1980s, batteries for electric cars (a notion we’d take over a century to take seriously), voting machines, and of course his enormous contribution to electric distribution systems. Despite the role of scientist and inventor being largely unglamorous, Thomas Edison and his tumultuous relationship with fellow inventor Nikola Tesla have been fodder for everything from books, to comics, to movies, and video games. Other Notable Moments from This Week in Geek History Although we only shine the spotlight on three interesting facts a week in our Geek History column, that doesn’t mean we don’t have space to highlight a few more in passing. This week in Geek History: 1971 – Apollo 14 returns to Earth after third Lunar mission. 1974 – Birth of Robot Chicken creator Seth Green. 1986 – Death of Dune creator Frank Herbert. Goodnight Dune. 1997 – Simpsons becomes longest running animated show on television. Have an interesting bit of geek trivia to share? Shoot us an email to [email protected] with “history” in the subject line and we’ll be sure to add it to our list of trivia. Latest Features How-To Geek ETC Here’s a Super Simple Trick to Defeating Fake Anti-Virus Malware How to Change the Default Application for Android Tasks Stop Believing TV’s Lies: The Real Truth About "Enhancing" Images The How-To Geek Valentine’s Day Gift Guide Inspire Geek Love with These Hilarious Geek Valentines RGB? CMYK? Alpha? What Are Image Channels and What Do They Mean? Clean Up Google Calendar’s Interface in Chrome and Iron The Rise and Fall of Kramerica? [Seinfeld Video] GNOME Shell 3 Live CDs for OpenSUSE and Fedora Available for Testing Picplz Offers Special FX, Sharing, and Backup of Your Smartphone Pics BUILD! An Epic LEGO Stop Motion Film [VIDEO] The Lingering Glow of Sunset over a Winter Landscape Wallpaper

    Read the article

  • Howto switch / chage user id witin a bash script to execute commands in the same script?

    - by a1an
    Is there a way to switch user identity within a script (executed as root as part of an installation process) to execute some commands without calling an external sctipt, then be back to root to run other commands? Sort of: #!/bin/bash some commands as root SWITCH_USER_TO user some commands as user including environment variables checks, without calling an external script SWITCH_USER_BACK some other stuff as root, maybe another user id change...

    Read the article

  • Bash Printing, how to

    - by Uncle Leo
    Wrote a script in bash. Now im need to bring information into a text file,for example in PostScript, but there is one problem. I need to have a certain length of string in characters, and stretch or shrink the string on the entire width of the page layout. I have tried a2ps and enscript, but there is no such option. Please tell me the solution to this problem, maybe in Ghostscript. Thanks in advance!

    Read the article

  • How to have multiple path separators in Bash

    - by binW
    I have few python scripts which were written by someone else in Windows. These scripts use double backslash as path separator but when run in Ubuntu they don't work because of this. I can change all \ to / and scripts will work but there are lot of scripts and its a lot of effort to change each \ to / So my question is: Is it possible to add \ as path separator in Ubuntu or only in Bash so that I dont have to modify these scripts?

    Read the article

  • This Week In Geek History: The Hitchhiker’s Guide, Compact Discs, and Whirlwind Foreshadows Operating Systems

    - by Jason Fitzpatrick
    Every week we look at fascinating facts and trivia from the history of Geekdom. This week we’re taking a look at The Hitchhiker’s Guide to the Galaxy, Compact Discs, and Whirlwind, the first computer to foreshadow modern operating systems. Latest Features How-To Geek ETC How To Make Disposable Sleeves for Your In-Ear Monitors Macs Don’t Make You Creative! So Why Do Artists Really Love Apple? MacX DVD Ripper Pro is Free for How-To Geek Readers (Time Limited!) HTG Explains: What’s a Solid State Drive and What Do I Need to Know? How to Get Amazing Color from Photos in Photoshop, GIMP, and Paint.NET Learn To Adjust Contrast Like a Pro in Photoshop, GIMP, and Paint.NET Bring the Grid to Your Desktop with the TRON Legacy Theme for Windows 7 The Dark Knight and Team Fortress 2 Mashup Movie Trailer [Video] Dirt Cheap DSLR Viewfinder Improves Outdoor DSLR LCD Visibility Lakeside Sunset in the Mountains [Wallpaper] Taskbar Meters Turn Your Taskbar into a System Resource Monitor Create Shortcuts for Your Favorite or Most Used Folders in Ubuntu

    Read the article

  • Why do digits in bash script names screw up path lookups?

    - by cannikin
    I've got a simple script that lists a bunch of EC2 servers and automates me connecting to them. This script lives at ~/bin/ec2 My PATH looks something like: /Users/rob/bin:/Users/rob:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin Whenever I call ec2 I get: -bash: /Users/rob/ec2: No such file or directory Unless I give it the full path, then it'll work. If I rename the script to just ec then I can run it from anywhere like expected. Have digits in script names always been a problem like this? I'm on Mac OSX.

    Read the article

  • Firefox completes the address bar with content absent from my history

    - by Antoine
    I have set Firefox to complete the address bar with elements from the history only ( other options are: nothing, bookmarks, and a history+bookmarks). However, Firefox still continues to complete the address bar with elements that are no longer in my history. A search in the history returns 0 result for the incriminated string. How can I solve this without loosing my entire history? I have already tried shift+delete on the elements I would like to delete, without success. How can I find the source of a certain completion ? (like an SQL request in the sqlite3 files used to store history) I'm using Firefox 16.0.2 on OS X 10.8.2.

    Read the article

  • Bash alias to open Vim at last edit mark

    - by Pierre LaFayette
    The mark " in Vim takes you to your last edit position. I want to create an alias that will open my Vim instance and jump to that mark; something which is obviously extremely useful. This works from the command line: $ vim -c "'\"" File.cpp Now I want to make an alias for this: $ alias v='vim -c "'\"" File.cpp' Well that's not going to work! You need to escape the first single quote you say... $ alias v='vim -c "\'\"" File.cpp' Hmm. That didn't work either... So I try a whole lot of variations of single quoted and double quoted madness, bang my head against the table and load up stackoverflow in my browser, and here we are. How do I properly escape this alias?

    Read the article

  • Bash alias to open Vim at last cursor position mark

    - by Pierre LaFayette
    The mark " in Vim takes you to your last cursor position. I want to create an alias that will open my Vim instance and jump to that mark; something which is obviously extremely useful. This works from the command line: $ vim -c "'\"" File.cpp Now I want to make an alias for this: $ alias v='vim -c "'\""' Well that's not going to work! You need to escape the first single quote you say... $ alias v='vim -c "\'\""' Hmm. That didn't work either... So I try a whole lot of variations of single quoted and double quoted madness, bang my head against the table and load up stackoverflow in my browser, and here we are. How do I properly escape this alias?

    Read the article

  • Bash completion doesn't work, or is ignoring what I've typed; but works for commands

    - by Neil Traft
    Bash completion seems to be ignoring what I've typed (it tries to complete, but acts as if there's nothing under the cursor). I know I saw it work on this machine earlier today, but I'm not sure what has changed. Some examples: cd shows all directories under my current folder: $ cd co<tab><tab> cmake/ config/ doc/ examples/ include/ programs/ sandbox/ src/ .svn/ tests/ Commands like ls and less show all files and directories under my current folder: $ ls co<tab><tab> cmake/ config/ .cproject Doxyfile.in include/ programs/ README.txt src/ tests/ CMakeLists.txt COPYING.txt doc/ examples/ mainpage.dox .project sandbox/ .svn/ Even when I try to complete things from a different folder, it gives me only the results for my current folder (telling me that it is completely ignoring what I've typed): $ cd ~/D<tab><tab> cmake/ config/ doc/ examples/ include/ programs/ sandbox/ src/ .svn/ tests/ But it seems to be working fine for commands and variables: $ if<tab><tab> if ifconfig ifdown ifnames ifquery ifup $ echo $P<tab><tab> $PATH $PIPESTATUS $PPID $PS1 $PS2 $PS4 $PWD $PYTHONPATH I do have this bit in my .bashrc, and I have confirmed that my .bashrc is indeed getting sourced: if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi I've even tried manually executing that file, but it doesn't fix the problem: $ . /etc/bash_completion There was even one point in time where it was working for ls, but was not working for cd ... but I can't replicate that result now. Update: I also just discovered that I have terminals open from earlier that still work. I ran source .bashrc in one of them and afterwards completion was broken. Here is my .bashrc: # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # # Modified by Neil Traft #source ~/.profile # Allow globs to expand hidden files shopt -s dotglob nullglob # If not running interactively, don't do anything [ -z "$PS1" ] && return # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth # append to the history file, don't overwrite it shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=2000 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize # If set, the pattern "**" used in a pathname expansion context will # match all files and zero or more directories and subdirectories. #shopt -s globstar # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" # set variable identifying the chroot you work in (used in the prompt below) if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi # Color the prompt export PS1="\[$(tput setaf 2)\]\u@\h:\[$(tput setaf 5)\]\W\[$(tput setaf 2)\] $\[$(tput sgr0)\] " # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' #alias dir='dir --color=auto' #alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # 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 ] && ! shopt -oq posix; then . /etc/bash_completion fi

    Read the article

  • How do I determine whether I am going "forward" or "backward" through my History in GWT?

    - by Stephen Cagle
    I am looking at History and History JavaDocs in GWT and I notice that there is no way to tell whether the forward or backward button was pressed (either pragmatically or by the user). The "button press" is handled by your registered addValueChangeHandler, but the only thing passed to the handler is a string on your history stack. There is no indication as to whether the "History" is moving "back" (using the back arrow button) or "forward" (using the right arrow button). Is there any way to determine this?

    Read the article

  • How to stop Bash appending history

    - by Craig
    I am having a lot of trouble setting up the terminal history of Bash the way I want. I would like to have no duplicate entries and if I enter a command I want it saved and the duplicates above removed. The problem is the history command shows me it is functioning the way I want however once I log out the duplicates come back again. I believe it is just appending the history to the existing one. I have these lines in my .bashrc file (~/.bashrc) HISTCONTROL=ignoreboth:erasedups shopt -u histappend I have even tried uncommenting shopt but it still appends the history on logout. How can I have the history be exactly how it is before I logout?

    Read the article

  • Trouble editing ~/.bash_profile: -bash: $'\r': command not found

    - by Dave
    I installed CygWin on Windows 7. Using Notepad, I edited my ~/.bash_profile file to add on to the PATH variable … PATH="${PATH}:/cygdrive/c/apache-ant-1.8.2/bin" Now, when I SSH in to my Windows machine, I get this error … -bash: $'\r': command not found -bash: $'\r': command not found -bash: $'\r': command not found -bash: $'\r': command not found -bash: $'\r': command not found -bash: /home/dev/.bash_profile: line 39: syntax error: unexpected end of file and my PATH is not set. Anyone know how I can correct this?

    Read the article

  • Configure Console2 to open bash in current folder

    - by davidkennedy85
    I've seen this but it doesn't work for me. I'm not using Git's version of bash but the one that comes with cygwin, so that could be part of the problem. Here is how I have my tab in Console2 set up: Title: bash.exe Shell: C:\cygwin\bin\bash.exe --login -i Startup dir: %HOMEDRIVE%%HOMEPATH% This is my registry entry: Directory shell Console2 Open Console2 Here command "C:\Console2\Console.exe" -d "%1" bash always starts in my home directory instead of the directory I'm clicking on, then I have to cd /cygdrive/d/code ... etc. I tried removing the value in the "Startup dir" field, changing it to %1, %1% with no luck. I also tried this solution but it didn't work for me either: Title: bash.exe Shell: C:\cygwin\bin\bash.exe -l Registry: Directory shell Console2 Open Console2 Here command "C:\Console2\Console.exe" -d "%V" .profile file in root directory: cd - Any ideas?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >