Search Results

Search found 9551 results on 383 pages for 'john shell'.

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

  • Shell script to copy files

    - by Hulk
    If there exist a directory, /backup/ And the files in it are a.gz b.gz c.gz And another directory /backup-directorybackup And the files in it are a.gz I need a shells script to compare two directories if the files are present then ignore it and if the filesare not present copy it to the destination directory Thanks..

    Read the article

  • Korn Shell - Test with variable that may be not set

    - by C. Ross
    I have the following code in KornShell FAILURE=1 SUCCESS=0 isNumeric(){ if [ -n "$1" ]; then case $1 in *[!0-9]* | "") return $FAILURE; * ) return $SUCCESS; esac; else return $FAILURE; fi; } #... FILE_EXT=${FILE#*.} if [ isNumeric ${FILE_EXT} ]; then echo "Numbered file." fi #... In some cases the file name not have an extension, and this causes the FILE_EXT variable to be empty, which causes the following error: ./script[37]: test: 0403-004 Specify a parameter with this command. How should I be calling this function so that I do not get this error?

    Read the article

  • UNIX Programs (Shell Scripting) [closed]

    - by atif089
    Hi, I have an exam tomorrow and I need some help with these programs. Or if you can tell me where I can get these. Write a program which uses grep to search a file for a pattern and display search patterns on standard output Write an awk program to print only odd numbered lines of a file. Write a program to open the command ls and give the output to the command through which we count the number of files Thank You :)

    Read the article

  • Bash Shell Scripting - How to iterate through directories, and copy and rename files?

    - by Cypher
    I have a directory setup as follows: /hosted/partner1/logo.png /hosted/partner2/logo.png /hosted/partner3/logo.png /hosted/partner4/logo.png /hosted/partner5/logo.png ..etc. I want to write a script that can COPY those files to a different location, with a different file name, like this: /partners/partner1.png /partners/partner2.png /partners/partner3.png ..etc. Any ideas? I'm not so great with shell scripting and there are a lot of files that I need to migrate to a single directory...

    Read the article

  • How to resolve broken dependencies of gnome-shell-extensions-user-theme package?

    - by swift
    After unsuccessful upgrade of Gnome3 packages in new Precise Pangolin 64-bit environment I get this error: The following packages have unmet dependencies: gnome-shell-extensions : Conflicts: gnome-shell-extensions-user-theme but 3.2.0-2~webupd8~oneiric is to be installed I tried to remove by running sudo apt-get purge gnome-shell-extensions-user-theme but get this: Package gnome-shell-extensions-user-theme is not installed, so not removed My Gnome Classic profile works well but Gnome3 session can't run. How to resolve this error?

    Read the article

  • Launch ubuntu software center from gnome shell

    - by Daniel Hughes
    I have been playing around with Gnome Shell from ubuntu 9.10. I installed the preview which is available in Ubuntu 9.10 repositories using sudo apt-get install gnome-shell gnome-shell --replace However I can't figure out how to launch Ubuntu Software Center using it. It just appears to be missing. The software center appears fine in normal gnome. How do you launch the Ubuntu Software Center from Gnome Shell. For those of you who are getting confused, Gnome Shell is the next generation user interface for gnome, it is planned for inclusion as default in Gnome 3.0, there is a preview of it in the Ubuntu 9.10 repositories. I am not interested in how to launch Ubuntu Software Center from the terminal or in how to launch it from the normal gnome interface.

    Read the article

  • How to run Windows 7 Explorer shell with Administrator Privileges by default

    - by Barry Kelly
    The Windows 7 shell (Explorer) can be made to run with Administrator privileges by this manual process: Kill Explorer shell by holding down Shift+Ctrl, right-clicking the Shut down button in the Start Menu, and selecting Exit Explorer Start Task Manager with Ctrl+Shift+Esc Elevate Task Manager privileges by going to Processes tab and selecting Show processes from all users Then start up a new instance of the shell by File | Run in Task Manager, typing in explorer, and selecting the Create this task with administrative privileges. After following the above process, the Windows shell will be running with administrative privileges, and any programs it launches will also have administrative privileges. This makes performing tasks that require the privilege far easier, particularly for command-line applications, which usually fail silently or with an Access denied. message rather than giving an opportunity to use UAC to elevate the process's privileges. What I'm interested in, though, is creating an account which uses a privileged shell by default, rather than having to follow this laborious process every time. How can it be done?

    Read the article

  • Run shell script on a command

    - by LinuxPenseur
    Hi, I want to run a shell script when date -s <string> command is used. For example i want to log the command to the file /tmp/user.log by executing the following command in the shell script logger -p user.notice "date -s command executed" -f /tmp/user.log How can run a shell script when date -s <string> is executed on the shell? To make it more general, I want to run my shell script when someone else issues a particular linux command on my system. How to do this?

    Read the article

  • How can I change shell in Ubuntu?

    - by Sanoj
    I have a Ubuntu Server VPS and I want to use /bin/bash/ as my shell. How can I change my shell? I have root access but I don't work as root. So dash is my default shell now. I have read How do I make Bash my default shell on Ubuntu? and chsh seams to be the preferred way to go. But when I type chsh /bin/bash I get this message: chsh: unknown user /bin/bash And if I just type /bin/bash the Bash shell seams to work fine. How to change it?

    Read the article

  • Shell script issue: cron job script to Restart MySQL server when it stops accidentally

    - by Straw Hat
    I have this script, I am using it to setup CRON job to execute this script, so it can check if MySQL service is running; if not then it restart the MySQL service: #!/bin/bash service mysql status| grep 'mysql start/running' > /dev/null 2>&1 if [ $? != 0 ] then sudo service mysql restart fi I have setup cron job as. sudo crontab -e and then added, */1 * * * * /home/ubuntu/mysql-check.sh Problem is that it restart MySQL on every cron job execution.. even if server is running it restart the MySQL service what is correction in the script to do that.

    Read the article

  • Gnome-shell worskpace preview on dual screen

    - by martin
    I'have isntalled gnome3 and I have dual screens(laptop, monitor). Is it possible to see the other monitor in workspace preview in the gnome panel??? I only can see primary monitor, that's why i'm not able to move windows inside the second screen? I've tried to change some settings in dconf , but with no luck. I want to have it like this http://stephen.rees-carter.net/wp-content/uploads/2011/04/Unity-workspace-switcher.png Does anyone have a solution?

    Read the article

  • What does /dev/null mean in the shell?

    - by rishiag
    I've started learning bash scripting by using this guide: http://www.tldp.org/LDP/abs/abs-guide.pdf However I got stuck at the first script: cd /var/log cat /dev/null > messages cat /dev/null > wtmp echo "Log files cleaned up." What do lines 2 and 3 do in Ubuntu (I understand cat)? Is it only for other Linux distributions? After running this script as root, the output I get is Log files cleaned up. But /var/log still contains all the files.

    Read the article

  • Is there any functional-like unix shell?

    - by Caruccio
    I'm (really) newbie to functional programming (in fact only had contact with it using python) but seems to be a good approach for some list-intensive tasks in a shell environment. I'd love to do something like this: $ [ git clone $host/$repo for repo in repo1 repo2 repo3 ] Is there any Unix shell with these kind of feature? Or maybe some feature to allow easy shell access (commands, env/vars, readline, etc...) from within python (the idea is to use python's interactive interpreter as a replacement to bash). EDIT: Maybe a comparative example would clarify. Let's say I have a list composed of dir/file: $ FILES=( build/project.rpm build/project.src.rpm ) And I want to do a really simple task: copy all files to dist/ AND install it in the system (it's part of a build process): Using bash: $ cp ${files[*]} dist/ $ cd dist && rpm -Uvh $(for f in ${files[*]}; do basename $f; done)) Using a "pythonic shell" approach (caution: this is imaginary code): $ cp [ os.path.join('dist', os.path.basename(file)) for file in FILES ] 'dist' Can you see the difference ? THAT is what i'm talking about. How can not exits a shell with these kind of stuff build-in yet? It's a real pain to handle lists in shell, even its being a so common task: list of files, list of PIDs, list of everything. And a really, really, important point: using syntax/tools/features everybody already knows: sh and python. IPython seams to be on a good direction, but it's bloated: if var name starts with '$', it does this, if '$$' it does that. It's syntax is not "natural", so many rules and "workarounds" ([ ln.upper() for ln in !ls ] -- syntax error)

    Read the article

  • trap "" HUP v.s Nohup ? How can I run a portion of shell script in nohub mode?

    - by Alex
    I want to run a shell script over the weekend, but I wanna make sure if the terminal loses the connection, my script won't be terminated. I use nohup for the whole script invokation, but I also want to execute some portion of my shell script in a way that if someone closes my terminal, my script runs on the background still. Here is a simple example : #!/bin/bash echo "Start the trap" trap " " HUP echo "Sleeping for 60 Seconds" sleep 60 echo "I just woke up!" Please suggest what I should do ? The trap " " HUP seems like not working when I close my terminal tab.

    Read the article

  • Setting default working directory/drive in Emacs shell on Windows

    - by Victor K.
    Hello, how can I change a default working directory/drive for shell in Emacs (on Windows)? Normally, shell starts in the same directory as the file in current buffer. However, when my current file is on D: drive, it starts in c:. Manually changing drive to D: in shell brings me to my directory of course, but I want to avoid this extra step. Is it possible?

    Read the article

  • Shell extension to display thumbnails of PDF files

    - by hamilton
    Foxit PDF, doesn't have a shell extension to display thumbnails of PDF files in Windows Explorer (the thumbnails are shown instead of PDF document icons). Is there a shell extension that do that? i.e to see thumbnails instead of PDF icon. BTW, PDFXchange and Adobe have a shell extension such that the thumbnails are shown instead of PDF document icons.

    Read the article

  • Override LDAP shell

    - by Incredible
    I have a LDAP server and a predefined shell (bash) set in it. But there are some machine on which I want a different shell to be used whenever user login to that instead of the shell stored in LDAP. How can I do this?? Can someone give me some direction in this? Thank you

    Read the article

  • Shell Script to Start Mysql Server if not running

    - by user103373
    I have written a shell script to start mysql server & send a mail to admin user if it's restarted via shell script. What i am facing an issue if I run this shell script on terminal it's work perfectly & If same script runs via cronjob it's only sending the mail to the user & problem remains same. Is this problem relates to permission & how can i resolve it. Shell Script-------- #!/bin/bash EMAIL="[email protected]" SERVICE='mysql' if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo "$SERVICE service running, everything is fine" else echo "$SERVICE is not running" /etc/init.d/mysql start cat <<EOF | msmtp -a gmail $EMAIL Subject: "Alert (Test Server) : Mysql Service is not running (Manually Restarted)" Mysql Server Restarted at: `date` EOF EXIT I am using msmtp for sending mail to the user on ubuntu 12.04 Server.

    Read the article

  • How do the environments of a standard Terminal command-line and a bash script differ?

    - by fred.bear
    I know there is something different about the environment of the Terminal command-line and the environment in a bash script, but I don't know what that difference is... Here is the example which finally led me to ask this quesiton; it may flush out some of the differences. I am trying to strip leading '0's from a number, with this command. var="000123"; var="${var##+(0)}" ; echo $var When I run this command from the Terminal's command-line, I get: 123 However, when I run it from within a script, it doesn't work; I get: 000123 I'm using Ubuntu 10.04, and tried all the following with the sam results: GNOME Terminal 2.30.2 Konsole 2.4.5 #!/bin/bash #!/bin/sh What is causing this difference? Even if some upgrade will make it work in scripts... I am trying to find out the what and why, so in future, I'll know what to look out for .

    Read the article

  • md5deep error with after compression and extraction

    - by Sai
    I am using md5deep to generate the checksum for the contents of an entire directory. After generation, if I use the checksum file and run a check, there are no errors. However, if I compress the file and extract it, it seems to generate an error about a missing file. The file is just called .md5. There is no file called .md5 inside the directory. It seems to create a file that is not existent. This problem exists when I use md5sum or md5deep. Any thoughts on why this is happening?

    Read the article

  • how do i set c-shell environment variables in tcsh shell script

    - by rambokayambo
    i am trying to set the environment variables in tcsh shell and it is not working. This is the syntax that i am using currently setenv MYSQL_HOME=/opt/mysql/mysql/bin my other question is i have a c-shell script that i am editing. Is setenv the same as a regular set MYSQL=${MYSQL_HOME}/bin/sqlplus? set MYSQL_HOME=/opt/mysql/mysql/bin or should i just set the MYSQL_HOME to where the mysql executable is ?

    Read the article

  • bash shell script which adds output of commands

    - by John Kube
    Let's say I have a command called foo which prints a number to the screen when called: $foo 3 Let's also say I have another command called bar which prints another number to the screen when called: $bar 5 I'm looking to write a shell script which will add together the output of foo and bar. How would I do that? (The outputs from the commands are not known ahead of time. They just so happen to have been 3 and 5 the last time they were run. They could have been something else.) Thanks!

    Read the article

  • Cannot install extensions required for GNOME Shell themes

    - by Soham Chowdhury
    I keep getting this output: soham@fortress:~$ sudo apt-get install gnome-shell-extensions gnome-tweak-tool Reading package lists... Done Building dependency tree Reading state information... Done gnome-tweak-tool is already the newest version. The following NEW packages will be installed: gnome-shell-extensions 0 upgraded, 1 newly installed, 0 to remove and 43 not upgraded. 1 not fully installed or removed. Need to get 0 B/121 kB of archives. After this operation, 849 kB of additional disk space will be used. Do you want to continue [Y/n]? y (Reading database ... 179291 files and directories currently installed.) Unpacking gnome-shell-extensions (from .../gnome-shell-extensions_3.4.1~git20120508.dfd7191a-0ubuntu1~12.04~ricotz0_all.deb) ... dpkg: error processing /var/cache/apt/archives/gnome-shell-extensions_3.4.1~git20120508.dfd7191a-0ubuntu1~12.04~ricotz0_all.deb (--unpack): trying to overwrite '/usr/share/locale/lv/LC_MESSAGES/gnome-shell-extensions.mo', which is also in package gnome-shell-extensions-common 3.2.0-0ubuntu1~oneiric1 No apport report written because MaxReports is reached already dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/gnome-shell-extensions_3.4.1~git20120508.dfd7191a-0ubuntu1~12.04~ricotz0_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) Update: Fixed that. Now GNOME Tweak Tool shows me an exclamation mark beside the extension enable button, saying "Extension doesn't support shell version". My GNOME shell is already the latest version. Help!

    Read the article

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