Search Results

Search found 5228 results on 210 pages for 'bash alias'.

Page 48/210 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • ERROR CHECKING !!

    - by moata_u
    am trying catch any error when run command in order to write an log file / report i was trying write this code : FUNCTION FOR VALIDATION function valid (){ if [ $? -eq 0 ]; then echo "$var1" ": status : OK" else echo "$var1" ": status : ERROR" fi COMMAND FUNCTION function save(){ sed -i "/:@/c connection.url=jdbc:oracle:thin:@$ip:1521:$dataBase" $search var1="adding database ip" valid $var1 sed -i "/connection.username/c connection.username=$name" #$search retval=$? var1="addning database SID" valid $var1 $retval } save OUTPUT adding database ip : status : OK sed: no input file i want out put in this way: adding database ip : status : OK sed: no input file : status : ERROR" (OR) adding database ip : status : OK addning database SID : status : ERROR" I was tried toooo much but not working with me :(((

    Read the article

  • How to move only a specific amount of images from a folder

    - by Luis Alvarado
    I have a folder that has 200.000 images. I want to do the following: Move an X amount of images (50 images, 100 images, 200 images) from that folder to Y folder. Each Y folder can be a number (Folder 1, Folder 2, Folder 3...). The end result might look like this: Folder 1 (Has X amount of images) Folder 2 (Has X amount of images) Folder 3 (Has X amount of images) Folder 4 (Has X amount of images)

    Read the article

  • Creating basic ACPI event makes the system unusably slow

    - by skerit
    I want to change a few settings on my laptop when I switch to battery power. I created a new event in /etc/acpi/events/cust-battery and it looks like this: event=battery action=/home/skerit/power.sh I put a simple command in the power.sh file: echo This is a test >> /home/skerit/powertest Now, when I tail this file it shows "This is a test" 4-5 times upon switching to battery power. However, the system becomes totally unstable. It slows down significantly. I can't change anything in the terminal. The terminal and certain parts of the screen (like the gnome system monitor applet) go blank from time to time. What can be the cause of that? It's a simple echo that gets executed a few times!

    Read the article

  • Chef bash resource not executing as specified user

    - by Arthur Maltson
    I'm writing a Chef cookbook to install Hubot. In the recipe, I do the following: bash "install hubot" do user hubot_user group hubot_group cwd install_dir code <<-EOH wget https://github.com/downloads/github/hubot/hubot-#{node['hubot']['version']}.tar.gz && \ tar xzvf hubot-#{node['hubot']['version']}.tar.gz && \ cd hubot && \ npm install EOH end However, when I try to run chef-client on the server installing the cookbook, I'm getting a permission denied writing to the directory of the user that runs chef-client, not the hubot user. For some reason, npm is trying to run under the wrong user, not the user specified in the bash resource. I am able to run sudo su - hubot -c "npm install /usr/local/hubot/hubot" manually, and this gets the result I want (installs hubot as the hubot user). However, it seems chef-client isn't executing the command as the hubot user. Below you'll find the chef-client execution. Thank you in advance. Saving to: `hubot-2.1.0.tar.gz' 0K ...... 100% 563K=0.01s 2012-01-23 12:32:55 (563 KB/s) - `hubot-2.1.0.tar.gz' saved [7115/7115] npm ERR! Could not create /home/<user-chef-client-uses>/.npm/log/1.2.0/package.tgz npm ERR! Failed creating the tarball. npm ERR! couldn't pack /tmp/npm-1327339976597/1327339976597-0.13104878342710435/contents/package to /home/<user-chef-client-uses>/.npm/log/1.2.0/package.tgz npm ERR! error installing [email protected] Error: EACCES, permission denied '/home/<user-chef-client-uses>/.npm/log' ... npm not ok ---- End output of "bash" "/tmp/chef-script20120123-25024-u9nps2-0" ---- Ran "bash" "/tmp/chef-script20120123-25024-u9nps2-0" returned 1

    Read the article

  • Command to determine whether a fullscreen application is running?

    - by George Edison
    I have a small shell script that plays a little jingle and displays a notification whenever I get a new email. The problem is that this shell script can get invoked anytime - including when I'm watching a DVD / video in fullscreen mode with the sound turned up quite a bit - which is quite annoying. I'd like to enhance this script with the ability to detect whether an application is in fullscreen mode. I know this must be somehow possible because notifications don't display under those circumstances. What command can I use?

    Read the article

  • Why isn't .profile sourced on login to LXDE?

    - by papukaija
    I switched recently from GNOME to LXDE and since then my .profile file hasn't been sourced on login. I found out that my PATH variable doesn't include ~/bin anymore. However, my .profile file includes PATH="$HOME/bin:$PATH" while PATH's content is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games. Is it intended that LXDE doesn't read this file on login? If yes, what file should I use to add the bin folder to the PATH variable? If not, to what package should I report a bug?

    Read the article

  • Converting Celsius Processor Temperature to Fahrenheit

    - by WindowsEscapist
    I'm editing a Conky theme. I would like it to output the processor temperatures in degrees Fahrenheit instead of Celsius. In the ~/.conkyrc file, the command sensors | grep 'Core 0' | cut -c18-19 is used to find the temperature in Celsius for the first processor core. I want to use bc to compute this (give it outputvalue*9/5+32). Problem is, bc wants just absolute values, and I see no way to pass it program output. If I try to use something like temp=$(sensors | grep 'Core 0' | cut -c18-19) & echo 'temp*9/5+32' | bc, it ends up giving me 32 because it registers "temp" as a 0.

    Read the article

  • Attempting to GREP details of a Java error

    - by BOMEz
    I'm running Ubuntu 11 and I'm having some issues with grep. I have a shell script (see below) which essentially checks if a certain Java program of mine is running, if not it runs it. That part works out great! If my Java application throws any kind of exception however I would like to capture that information and email it to myself. How can I go about checking to see if the call to java -jar /bin/MyApp.jar fails? I tried piping it to grep, but that doesn't seem to work. Below is the full script that I've written: #Check if MyApp.jar is running, if not run it. if [ $(ps aux | grep 'java' | grep -v grep | wc -l | tr -s "\n") -eq 0 ] then echo "PacketCapture Starting...\n" java -jar /bin/MyApp.jar echo "PacketCapture Started.\n" else echo "PacketCapture already running.\n" fi

    Read the article

  • How do I select a field/column from the output of `ls -l`?

    - by soandos
    My goal is deceptively simple (at least to me). I wish to take the output of ls -l or ls -lh and select just one field. I am looking for this to be as bulletproof as possible, by which I mean, assume that filenames can have a variable number of spaces, not everything in the field has the same length, etc. Bonus points for having a script that will take the name of the the field (or even just a field number), and then return the contents of the field. I want to turn into:

    Read the article

  • How do I include a password with SSH command? (want to make shell script)

    - by Evan
    I'm trying to SSH to a server on startup with a .sh script, but that will require me to enter the password for the account on the server that I'm SSHing to. I did some RTFMing, and I see in "-o" that it has "PasswordAuthentication" but I'm not sure how or if I could use that option. As this will be in a shell script, obviously I'd like to have the password in that file, or in any case not have to enter in the password manually every time the script runs.

    Read the article

  • Logging every time a command is run

    - by Tom D
    I want to log every time I run a certain type of command in the terminal. For example, every time I run: sudo apt-get install [something] I want to add [something] to a log file in my home directory that will look like the following: [timestamp] [something] 2012-10-02 mysql-server 2012-10-03 ruby1.9.1 2012-10-06 gedit-plugins 2012-10-07 gnome-panel synaptic What's the easiest way to make this happen automatically?

    Read the article

  • How to xkill an application by its id?

    - by Hanynowsky
    I need to simulate the behavior of the keyboard shortcut (ALT+F4) using Terminal for a given application. If I open for example gedit and click ALT + F4 , then GEDIT will be xkilled. If I want to achieve same thing using Terminal, how should I proceed? The command export PIDTOKILL=pidof gedit | grep [^*]; xkill -id $PIDTOKILL does not work and gives the following error: xkill: killing creator of resource 0x3f38 X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 113 (X_KillClient) Value in failed request: 0x3f38 Serial number of failed request: 8 Current serial number in output stream: 9 I think I am confusing application id and process id here

    Read the article

  • Problem manipulating text using grep

    - by moata_u
    I want to search for a line that contains log4j and take 7 lines before and 3 lines after the match. grep -B7 -A3 "log4j" web.xml After that I want to add comment tags before this paragraph and after it. <!-- paragraph that i found by grep --> I wrote this script bellow: search=`find . -name 'web.xml'` text=`grep -B7 -A3 "log4j" $search` sed -i "/$text/c $newparagraph" $search It's not working. Is there any way to just add comment symbol not replace the paragraph? What I want to the script to do: search for the paragraph append append -- at the end Edit: This is the paragraph that am trying manipulate : <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/classes/log4j.properties</param-value> </context-param> <listener> <listenerclass> org.springframework.web.util.Log4jConfigListener </listener-class> </listener> This paragraph is part of many paragraphs! I want make it like this: <!-- <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/classes/log4j.properties</param-value> </context-param> <listener> <listenerclass> org.springframework.web.util.Log4jConfigListener </listener-class> </listener> -->

    Read the article

  • Can I use standard tools to get the full name of a process, when its name has embedded spaces?

    - by fred.bear
    I understand that it may be a rare situation for an executable to have spaces in it, but it could happen. An example may be the best explanation.. Using standard tools, I want to determine the location (on the file system) of the executable which owns(?) the current window... get the current window ID ...(xdotool getactivewindow ) use the ID to get the PID ...(wmctrl -p -l | sed ... ID .... use the PID to get the executable's name ... (ps -A ... here is where I run into problems ! Whith ps, when listing only the executable's name (-o ucmd), it truncates the name to 15 characters, so this rules out this option for any name which is longer. Widening the column (-o ucmd:99 ) makes no difference.. If pgrep is anything to go by, its matching is limited to 15 because of stat (see: info pgrep).. Listings in variants of "full" mode (eg -A w w) are not useful when the name concerned has spaces in it, because this name is separated from its args by another space!.. Also, in "full" mode, if the process was started by a link, the name of the link is shown, rather than the executable's name. Is there some way to do this (using standard tools)? ...or are spaces a show stopper here?

    Read the article

  • Why ~/.bash_profile is not getting sourced when opening a terminal in Ubuntu 11.04?

    - by Viriato
    Problem I have an Ubuntu 11.04 Virtual Machine and I wanted to set up my Java development environment. I did as follows sudo apt-get install openjdk-6-jdk Added the following entries to ~/.bash_profile export JAVA_HOME=/usr/lib/jvm/java-6-openjdk export PATH=$PATH:$JAVA_HOME/bin Save the changes and exit Open up a terminal again and typed the following echo $JAVA_HOME (blank) echo $PATH (displayed, but not the JAVA_HOME value) Nothing happened, like if the export of JAVA_HOME and it's addition to the PATH were never done. Solution I had to go to ~/.bashrc and add the following entry towards the end of file #Source bash_profile to set JAVA_HOME and add it to the PATH because for some reason is not being picked up . ~/.bash_profile Questions Why did I have to do that? I thought bash_profile, bash_login or profile in absence of those two get executed first before bashrc. Was in this case my terminal a non-login shell? If so, why when doing su after the terminal and putting the password it did not execute profile where I had also set the exports mentioned above?

    Read the article

  • How to copy files via terminal?

    - by Levan
    This might sound silly for some people but I'm new to Linux and don't know how to use it as good as other people, yes I rad about copying files with terminal but these examples will help me a lot. So here is what I want to do: Examples: I have a file in /home/levan/kdenlive untitelds.mpg and I want to copy this file to /media/sda3/SkyDrive and do not want to delete any thing in SkyDrive directory. I have a file in /media/sda3/SkyDrive untitelds.mpg and I want to copy this file to /home/levan/kdenlive and do not want to delete any thing in kdenlive directory I want to copy a folder from home directory to sda3 and do not want to delete any thing on sda3 directory and opposite I want to cut a folder/file and copy to other place without deleting files in that directory I cut it into.

    Read the article

  • What has 'rm -r ~' done to my home directory?

    - by GUI Junkie
    gedit creates hidden backup files ending with '~'. I wanted to do a recursive cleanup of my directory tree. The command rm *~ will delete all local files ending with '~' I thought rm -r *~ . would delete all files in the whole tree, but I typo-ed rm -r ~. There was a message some directory could not be deleted and I quit the command. The question is: What have I been deleting? I did notice that my Filezilla configuration was gone. Does this command delete all hidden directories from the home dir?

    Read the article

  • Open Terminal with multiple tabs and execute application

    - by user172001
    I am new to linux shell scripting. I want to write a shell script which will open terminal with multiple tabs; it should run rtsp client app in each tab. For this, I have gone through question here in this forum and tried to code like bellow, tab="--tab-with-profile=Default -e " cmd="java RunRTSPClient" for i in 1 2 3 4 5 do # foo="$foo $tab $cmd" done gnome-terminal $foo exit 0 This is running and opens the terminal window with tabs but suddenly it will close. I am not getting any errors.

    Read the article

  • Installing a directory with a Debian Package

    - by Meisie
    Hi guys I want to create a Debian Package that installs a bunch of Folders to a system but I can't get it working. The Package gets created without any errors and lintian also says it's okay but installing does nothing. The rules file looks like this: <#>!/usr/bin/make -f logs = $(CURDIR)/shell_logs/ DEST1 = /opt/Pacetutor/ build: build-stamp build-stamp: dh_testdir touch build-stam clean: dh_testdir dh_testroot rm -f build-stamp dh_clean install: build clean $(logs) dh_testdir dh_testroot dh_prep dh_installdirs mkdir -m 755 -p $(DEST1) <- this is propably optional or not needed -> cp -r $(logs) $(DEST1) <- using mv works but thats not what I want. -> binary-indep: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples dh_installman dh_link dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb binary-arch: build install binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install

    Read the article

  • When is it appropriate to use colour in a command-line application?

    - by marcoms
    Currently I have a command-line application in C called btcwatch. It has a -C option that it can receive as an argument that compares the current price of Bitcoin with a price that was stored beforehand with -S. Example output with this option is: $ btcwatch -vC # -v = verbose buy: UP $ 32.000000 USD (100.000000 -> 132.000000) sell: UP $ 16.000000 USD (100.000000 -> 116.000000) The dilemma is whether to use colour for the UP or DOWN string (green and red, respectively). Most command-line applications I know of (apart from git) stay away from colour in their output. In my desire for btcwatch to look and be quite "standard" (use of getopt, Makefiles, etc), I'm not sure if colour would look out of place in this situation.

    Read the article

  • Copying specific subfolders with directory structure to a new folder

    - by Shan
    I have the following directory structure: Main_Dir | ------------------------------ Subdir1 Subdir2 Subdir3 | | | ----------- ---------- --------- | | | | | | | | | fo1 fo2 f03 fo1 fo2 f03 fo1 fo2 f03 I want to copy all the subdirectories (Subdir1, Subdir2, Subdir3) to a new folder. But how would I only copy fo1 and fo2 folders to the new place?

    Read the article

  • Git autocomplete is asking for a password, not sure why

    - by Soldier.moth
    I'm running into an issue with autocomplete using git... I am using ubuntu 12.10 and when I perform the following keystrokes g i t Space Bar Tab I am presented with the error Pseudo-terminal will not be allocated because stdin is not a terminal. and prompted for a password. I am not clear how to go about troubleshooting this error, I have tried uninstalling and reinstalling git to no avail. Screenshot of terminal with error:

    Read the article

  • read file in shell script

    - by moata_u
    how can i read file in shell script , then assign each line to an variable that i can use later ,,,(am thinking in way to load an default setting from file) i already try : process (){ } FILE='' read -p "Please enter name of default file : " FILE if [ ! -f $FILE ]; then echo "$FILE : does not exists " exit 1 elif [ ! -r $FILE ]; then echo "$FILE : can not read " fi exec 0<"$FILE" n=0 while read -r line do (assign each line to an variable) done

    Read the article

  • need a different backup solution

    - by DigitalJedi
    I just built a new media/backup server using Ubuntu 12.04 64bit. I installed a hard drive to be used only for music, pictures, and videos and formatted it fat32 so my 1 and only Windows PC could map those folders as netshares. My laptop, also running Ubuntu 12.04, is what I am using the most so new media is first downloaded on my laptop. I've already got the music, videos, and pictures folders from my server mounting as shares on my laptop on boot thanks to some fstab edits and sshfs. Now I'm wanting either an app or script that could backup any new files I add to my local media folders to the mounted folders on my server. I've been Googling all day and found a few apps like rsync but they seem to have issues with ext4 to vfat backups. I thought maybe a script would be best but I'm new to scripting in Linux and don't want to mess anything up. Basically I am looking for something that will backup only newly added files to the server. I figure I could schedule it once a week. There are some stipulations. For example, my local music folder has over 700 folders for each artist/band then sub folders inside those for albums. I want something smart enough to only copy newly added content so I'm guessing the modified date would probably be a good condition if I were scripting. I'm rambling. Any suggestions would be GREATLY appreciated. I'm not finding anything to suit my needs. I'm almost to the point of just learning bas scripting so I can write something but then it will be a couple weeks or so before I have a possible solution and I'd like something in place sooner.

    Read the article

  • ssh:connection timed out

    - by user1155299
    I am trying the following command on ubuntu ssh [email protected] and I get the following error: ssh: connect to host xx.xx.xxx.xxx port 22: Connection timed out so, I tried the following: telnet xx.xx.xxx.xxx 22xx and I got the following message: Trying xx.xx.xxx.xxx... Connected to xx.xx.xxx.xxx. Escape character is '^]'. SSH-2.0-OpenSSH_5.5 Connection closed by foreign host. Can anyone help me understand what the problem is and how I can fix it.

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >