Search Results

Search found 25651 results on 1027 pages for 'shell script'.

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

  • Command passed as argument to shell script

    - by raj_arni
    Hi, I want to pass a command to a shell script. This command is a grep command. While executing I am getting the following errors, please help: myscript.sh "egrep 'ERROR|FATAL' \*20100428\*.log | grep -v aString" myscript.sh is a simple script: #!/bin/ksh cd log $1 the errors are: egrep: can't open | egrep: can't open grep egrep: can't open -v egrep: can't open aString Error is because egrap sees |, grep, -v and aString as arguments.

    Read the article

  • Parsing result of Diff in Shell Script

    - by Saobi
    I want to compare two files and see if they are the same or not in my shell script, my way is: diff_output=`diff ${dest_file} ${source_file}` if [ some_other_condition -o ${diff_output} -o some_other_condition2 ] then .... fi Basically, if they are the same ${diff_output} should contain nothing and the above test would evaluate to true. But when I run my script, it says [: too many arguments On the if [....] line. Any ideas?

    Read the article

  • writing a shell script if statement to check for directory

    - by user1553248
    I need to write a script that will recreate my opt folder if it gets deleted when I remove a package from it. Here's a link to my previous post: dpkg remove to stop processes Now, the issue I'm running into could be better described here: http://lists.debian.org/debian-devel/2006/03/msg00242.html I was thinking of just adding a postrem script which checks if an opt directory exists, and if not, creates one. My experience with shell scripts is pretty limited though..

    Read the article

  • script calling script as other user

    - by viktor tron
    Using CentOs, I want to run a script as user 'training' as a system service. I use daemontools to monitor the process, which needs a launcher script that is run as root: : #!/bin/bash exec >> /var/log/training_service.log 2>&1 setuidgid training training_command This last line is not good enough since for training_command, we need environment for training user to be set. : su - training -c 'training_command' gives 'standard in must be tty' as su making sure tty is present to potentially accept password. I know I could make this disappear by modifying /etc/sudoers a la Bash & 'su' script giving an error "standard in must be a tty" but i am reluctant and unsure of consequences. : runuser - training -c 'training_command' gives runuser: cannot set groups: Connection refused. I found no sense or resolution to this message. I am stuck. Is this something so hard to achieve? I appreciate all insight and guidance to best practice.

    Read the article

  • shell script to set time and date on ubuntu

    - by glapo
    my desktop CMOS battery is not working, therefore I have to set time and date each time my computer starts up. I want to create a shell script to automate the setting of date and time on my computer after each boot is complete. options that exist include: 1. buying a CMOS battery :- am considering this, but for the meantime a shell script will do. 2. using NTP to synchronize time and date with internet servers :- am not connected to the internet.

    Read the article

  • Awesome-WM inside gnome-shell -> Get rid of top bar

    - by joe8
    I am using awesome-wm now, and was trying to get it working with gnome-shell. I have basically followed those steps: http://awesome.naquadah.org/wiki/Quickly_Setting_up_Awesome_with_Gnome#Ubuntu_11.10 But now I have two bars, one at the bottom and one at the top. Is there any way to get rid of one of those (preferring top bar). If that is not possible, is there a way to load the gnome-shell widgets in the top bar? Now it's only displaying the time. screen: Thanks ;)

    Read the article

  • ATI graphics card, with gnome shell on Ubuntu 11.10, screen flickers

    - by bioShark
    After installing gnome shell, without any problem, after log in the fonts are missing and it looks like crap...nothing is readable. Don't want to make it a double post, because my issue is similar to the one from this question but for me the problems have not been solved properly. After running the commands from that post, and installing the latest AMD 11.10 driver, the Gnome shell display issues have been solved. But each time I move the mouse in the upper left corner, to bring up the applications...my entire screen flickers. Without the applications been displayed, everything looks fine. Hardware: ATI HD4870, Intel Q6600.

    Read the article

  • How do I fix gnome shell themes?

    - by Chris
    This is my fifth full format and install of Ubuntu in under a month. I finally have my Gnome 3 desktop working again, but again, the Gnome shell themes is not select-able. I have asked the question of how to fix this common issue before, but I have seen no positive resolution. Does anybody know of a simple fix? This is a common issue and I have seen hundreds of postings related to it, but other users only seem to get half-way answers also and it goes unresolved. Would it be advisable to completely purge Gnome desktop and reinstall? If so how would I do this? I cannot use any extensions if the shell is not working, so I am desperately seeking resolution for the issue. Thanks in advance.

    Read the article

  • Ubuntu 11.10 Gnome Shell new window focus problem

    - by grafthez
    I'm using gnome shell with new ubuntu for few days now and have experienced really annoying behaviour with new windows. Sometimes when I use another window and press e.g. Alt Ctrl T to open new terminal window, I don't get this window being brought to front. Instead I get notification at the bottom that "New terminal window is ready to use". The same is with Pidgin being integrated with gnome shell (via extension). Every time I get new message, window pops up but doesn't show. I need to either Alt Tab it or click the notification. Is there any way to have new windows being always brought to front, and remove those annoying "Window is ready" notifications?

    Read the article

  • Only close button shows up in Google Chrome in GNOME Shell

    - by TreefrogInc
    After I installed the GNOME shell in Ubuntu, I decided that I didn't like having the "Close/Minimize/Maximize" buttons on the right, so I switched them over to the left using gconftool-2 --set "/apps/metacity/general/button_layout" --type string "close, minimize, maximize:" After resetting the shell, however, I found that with the GTK+ theme, only the close button shows up. Using system title bar and borders will make all the buttons appear, but I really want to use the theme because the system title bar makes the top bar too thick. Logging out and back in didn't fix it, and I tried reinstalling Chrome, but the problem persists.

    Read the article

  • What's shell script's advantage over interpreted programming languages?

    - by Lai Yu-Hsuan
    (I'm not sure if it's a appropriate question here) Shell script, like bash, can do many things. It can call Unix programs, pipe their output, redirect I/O from/to files, control flow, check whether a file exists, etc. But a modern programming language, e.g, python and ruby, can also do these all. And their are (I think) more readable and maintainable. bash is worldwide spreaded. But many distributions have installed python interpreter, too. So what's the advantage of shell script? If I could write python, ruby or perl, is it worth to learn bash?

    Read the article

  • ATI graphics card, with gnome shell, screen flickers

    - by bioShark
    After installing gnome shell, without any problem, after log in the fonts are missing and it looks like crap...nothing is readable. Don't want to make it a double post, because my issue is similar to the one from this question but for me the problems have not been solved properly. After running the commands from that post, and installing the latest AMD 11.10 driver, the Gnome shell display issues have been solved. But each time I move the mouse in the upper left corner, to bring up the applications...my entire screen flickers. Without the applications been displayed, everything looks fine. Hardware: ATI HD4870, Intel Q6600.

    Read the article

  • New windows from the dock in Gnome Shell

    - by Andrea
    I am using Gnome Shell on Ubuntu 11.10, and I frequently use workspaces, as the shell encourages to do. My only complaint is that it is slow to place different windows of the same program in different workspaces. What I would like to do: click on an empty workspace, click on the Nautilus icon in the dock and browse to the correct folder. Then click on another empty workspace, click on the Nautilus icon and so on. This does not work: the second time I open Nautilus, the dock lets me switch to the previous instance, which is almost never what I want. So I have to click on the Nautilus icon, open a new window, place it on a different desktop, switch to that folder and finally browse to the correct folder. Is there a way to simplify this flow? It would be even better if I was able to link a specific folder from the dock, or better yet to have something similar to a Unity lens, where I can choose between the most used folders.

    Read the article

  • How to disable Gnome-Shell auto-open in Dashboard

    - by user48027
    I am personalising my Gnome-Shell in Ubuntu 11.10 I would like to disable the feature to open the Gnome's Dashboard when I close the last Window in a Workspace. Edit to clarify: The dashboard is available only in GNOME Shell. The dashboard opens if you press the windows key (aka SUPER) or if you move the mouse to the upper left corner. If you close the last window of a workspace, but there are open windows on other workspaces, the dashboard opens automatically. The latter behaviour is annoying if you do not want to use the dashboard to open new windows or to change workspace. There are many ways to to both (Gnome do, Docky, keyboard shortcuts, clicking on something on the desktop, ...). Edit: There is a related Q&A, which was closed because the asked the same question for Mint: How can I prevent the activity view for opening when I close the last running app?

    Read the article

  • Writing a basic C Shell - understanding argv[] [on hold]

    - by Flame
    I have an assignment for my class to write a basic C Shell. I have found many pages that explain parts of it and some fully implemented code. I'm not going to copy, i'm just using it right now as a way to get started. So I'm at the beginning of this project obviously. One example I am looking at parses the user's input and stores a pointer to the beginning of the argument in char *argv[3]; Am I just misunderstanding this or would this technically break if there are more than 3 arguments? (say /a.out arg1 arg2 arg3 etc). Would I wanna malloc this somehow? I know a.out is considered argv[0], and the arguments argv1 - however many there are. It's probably bad practice to have too many arguments for a program, but I still would at least want to address it as I don't know what my TA's are going to use to test my shell.

    Read the article

  • Is there a way to prevent output from backgrounded tasks from covering the command line in a shell?

    - by Chris Pick
    I would like to be able to run task(s) in the background of a shell and not have their output to stdout or stderr cover the command line at the bottom. Frequently I need to run other commands to interact with the background processes and would like to do so from the same shell without having to open up another terminal or using multiplexer to split the terminal like screen. Ideally there would be some setting that I just don't know about (I commonly use bash or ksh), but a new or different shell or a script would be fine by me. I'm open to any suggestions and appreciate any help, thanks.

    Read the article

  • Modify shell script to monitor/ping multiple ip addresses

    - by Alex
    Alright so I need to constantly monitor multiple routers and computers, to make sure they remain online. I have found a great script here that will notify me via growl(so i can get instant notifications on my phone) if a single ip cannot be pinged. I have been attempting to modify the script to ping multiple addresses, with little luck. I'm having trouble trying to figure out how to ping a down server while the script keeps watching the online servers. any help would be greatly appreciated. I haven't done much shell scripting so this is quite new to me. Thanks #!/bin/sh #Growl my Router alive! #2010 by zionthelion73 [at] gmail . com #use it for free #redistribute or modify but keep these comments #not for commercial purposes iconpath="/path/to/router/icon/file/internet.png" # path must be absolute or in "./path" form but relative to growlnotify position # document icon is used, not document content # Put the IP address of your router here localip=192.168.1.1 clear echo 'Router avaiability notification with Growl' #variable avaiable=false com="################" #comment prefix for logging porpouse while true; do if $avaiable then echo "$com 1) $localip avaiable $com" echo "1" while ping -c 1 -t 2 $localip do sleep 5 done growlnotify -s -I $iconpath -m "$localip is offline" avaiable=false else echo "$com 2) $localip not avaiable $com" #try to ping the router untill it come back and notify it while !(ping -c 1 -t 2 $localip) do echo "$com trying.... $com" sleep 5 done echo "$com found $localip $com" growlnotify -s -I $iconpath -m "$localip is online" avaiable=true fi sleep 5 done

    Read the article

  • Batch file script for Enable & disable the "use automatic Configuration Script"

    - by Tijo Joy
    My intention is to create a .bat file that toggles the check box of "use automatic Configuration Script" in Internet Settings. The following is my script @echo OFF setlocal ENABLEEXTENSIONS set KEY_NAME="HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" set VALUE_NAME=AutoConfigURL FOR /F "usebackq skip=1 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO ( set ValueName=%%A set ValueType=%%B set ValueValue=%%C ) @echo Value Name = %ValueName% @echo Value Type = %ValueType% @echo Value Value = %ValueValue% IF NOT %ValueValue%==yyyy ( reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "yyyy" /f echo Proxy Enabled ) else ( echo Hai reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "" /f echo Proxy Disabled ) The output i'm getting for the Proxy Enabled part is Value Name = AutoConfigURL Value Type = REG_SZ **Value Value =yyyy** Hai The operation completed successfully. Proxy Disabled But the Proxy Enable part isn't working fine the output i get is : Value Name = AutoConfigURL Value Type = REG_SZ **Value Value =** ( was unexpected at this time. The variable "Value Value" is not getting set when we try to do the Proxy enable

    Read the article

  • Select (loop) or command not working in shell-script

    - by user208098
    I've been tinkering with Linux and Unix for years but still a novice in my mind and recently find myself trying to be more pro with it as I work in IT. So with that notion I'm studying shell scripting. I've hit a snag in ubuntu using the latest version 13.10 Saucy. When I use the select command in a sh script it doesn't work, depending on how I format the command it will either return Unexpected "do" or Unexpected "done". See the following two examples: This section of code produces an unexpected "do" error: #/bin/bash PS3='Please enter your choice' select opt in option1 option2 option3 quit do case $opt in "option1") echo "you chose choice 1" ;; "option2") echo "you chose choice 2" ;; "option3") echo "you chose choice 3" ;; "quit") break ;; *) echo invalid option ;; esac done This section of code produces an unexpected "done" error. #/bin/bash PS3='Please enter your choice' select opt in option1 option2 option3 quit ; do case $opt in "Option1") echo "you chose choice 1" ;; "Option2") echo "you chose choice 2" ;; "Option3") echo "you chose choice 3" ;; "quit") break ;; *) echo invalid option ;; esac done When I enter these parameters into the command line interactively or manually I get the desired result which is a list of choices to choose from. However when executed from a script I get the before mentioned errors. Also a side note I have tried this in Fedora as a script and it worked perfectly so my question is why isn't it working in Ubuntu, is this a difference between RHL and Debian? Or is it a bug in the latest version of Ubuntu? Thanks in advance for any help! KG

    Read the article

  • idioms for returning multiple values in shell scripting

    - by Wang
    Are there any idioms for returning multiple values from a bash function within a script? http://tldp.org/LDP/abs/html/assortedtips.html describes how to echo multiple values and process the results (e.g., example 35-17), but that gets tricky if some of the returned values are strings with spaces in. A more structured way to return would be to assign to global variables, like foo () { FOO_RV1="bob" FOO_RV2="bill" } foo echo "foo returned ${FOO_RV1} and ${FOO_RV2}" I realize that if I need re-entrancy in a shell script I'm probably doing it wrong, but I still feel very uncomfortable throwing global variables around just to hold return values. Is there a better way? I would prefer portability, but it's probably not a real limitation if I have to specify #!/bin/bash.

    Read the article

  • Shell script to process files

    - by Harish
    I need to write a Shell Script to process a huge folder of nearly 20 levels.I have to process each and every file and check which files contain lines like select insert update When I mean line it should take the line till I find a semicolon in that file. I should get a result like this C:/test.java select * from dual C:/test.java select * from test C:/test1.java select * from tester C:/test1.java select * from dual and so on.Right now I have a script to read all the files #!bin/ksh FILE=<FILEPATH to be traversed> TEMPFILE=<Location of Temp file> cd $FILE for f in `find . ! -type d`; do cat $FILE/addedText.txt>>$TEMPFILE/newFile.txt cat $f>>$TEMPFILE/newFile.txt rm $f cat $TEMPFILE/newFile.txt>>$f rm $TEMPFILE/newFile.txt done I have very little knowledge of awk and sed to proceed further in reading each file and achieve what I want to.Can anyone help me in this

    Read the article

  • Shell Script - comparing lines of text, deleting matches

    - by SirRatty
    Hi all, I've done some searching for this but cannot find what I'm after, specifically. I have two files: "a.txt", "b.txt". Each contains a list of email addresses, separated by newlines. For all lines in "a.txt", I need to check for a match anywhere in "b.txt". If so, the email address in "a.txt" needs to be removed. (Alternatively, a new file "c.txt" could be created with the output if that is easier.) I'm using Mac OS X, so am looking for a shell script that could help, or pointers to how I'd go about constructing the script. Thanks for any help.

    Read the article

  • Reading into directory, unix shell script

    - by dubya
    I am trying to analyze the files/directories inside of a directory using a shell script, for example if the file is readable, if it is a file, if it is a directory, etc. My script is set up to take a directory as input. so I would type 'file.sh directoryname'. However, when I create a for loop to analyze the files, it analyzes the files in my current working directory rather than the specified directory name. This is my broken code: file=$1 set mypath = $file for file in $mypath * do if [ -d $file ] dirCount=`expr $dirCount + 1` fi done Why does this read the working directory instead of the specified directory? Any help is appreciated. Thanks

    Read the article

  • Sum in shell script

    - by Dinis Monteiro
    Why can't I create a sum of total words in this script? I get the result something like: 120+130 but it isn't 250 (as I expected)! Is there any reason? #!/bin/bash while [ -z "$count" ] ; do echo -e "request :: please enter file name " echo -e "\n\tfile one : \c" read count itself=counter.sh countWords=`wc -w $count |cut -d ' ' -f 1` countLines=`wc -l $count |cut -d ' ' -f 1` countWords_=`wc -w $itself |cut -d ' ' -f 1` echo "Number of lines: " $countLines echo "Number of words: " $countWords echo "Number of words -script: " $countWords_ echo "Number of words -total " $countWords+$countWords_ done if [ ! -e $count ] ; then echo -e "error :: file one $count doesn't exist. can't proceed." read empty exit 1 fi

    Read the article

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