Search Results

Search found 8028 results on 322 pages for 'unix shell'.

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

  • unix message queue

    - by Betamoo
    Is there an ipc option to get the last message in message queue but not removing it? I want this to allow many clients reading same messages from the same server.. Thanks

    Read the article

  • How to number the ls output in unix?

    - by Snehal
    I am trying to write a file with format - "id file_absolute_path" which basically lists down all the files recursively in a folder and give an identifier to each file listed like 1,2,3,4. I can get the absolute path of the files recursively using the following command: ls -d -1 $PWD/**/*/* However, I am unable to give an identifier from the output of the ls command. I am sure this can be done using awk, but can't seem to solve it.

    Read the article

  • Make Arrow and delete keys work in Korn shell Command line

    - by user66854
    Hi all, I am new to unix and am using sun solaris (v10 i think) . I have my shell set as korn shell . i am wondering how to make the arrow keys and delete key work in the command line . I have done set -o emacs and the backspace works , but not the arrow keys and the delete keys . Also is it possible to set the up and down arrow key to cycle through the command line history ? . any help is appreciated .

    Read the article

  • Notify via email if something wrong got happened in the shell script

    - by Nevzz03
    fileexist=0 for i in $( ls /data/read-only/clv/daily/Finished-HADOOP_EXPORT_&processDate#.done); do mv /data/read-only/clv/daily/Finished-HADOOP_EXPORT_&processDate#.done /data/read-only/clv/daily/archieve-wip/ fileexist=1 done --some other script below Above is the shell script I have in which in the for loop, I am moving some files. I want to notify myself via email if something wrong got happened in the moving process, as I am running this script on the Hadoop Cluster, so it might be possible that cluster went down while this was running etc etc. So how can I have better error handling mechanism in this shell script? Any thoughts?

    Read the article

  • I've changed default shell but my terminal don't get it

    - by om-nom-nom
    Recently I've changed my default shell from bash to zsh like this: chsh -s /bin/zsh myname But when I invoke a new terminal (e.g. using ctrl+alt+T) I still have bash loaded: myname@machine:~$ cat /etc/passwd | grep myname myname:x:1000:1000:myname,,,:/home/myname:/bin/zsh myname@machine:~$ echo $SHELL /bin/bash zsh is installed and can be explicitly runned with zsh command. How to deal with that?

    Read the article

  • Gnome Shell Blank edge until restart?

    - by jtaillon
    Since I installed Gnome Shell (which I much prefer over Unity), there has been a small annoyance appearing on the right side of my screen. As you can see in the picture below, there is a blank few pixels on the right side of the screen. It goes away if I reload gnome-shell ("r" command), but obviously, I'd prefer that this is not necessary. I'm not sure what exactly is causing this, but was hoping someone might be able to help. I'm running Ubuntu 11.10 on a Lenovo Thinkpad Edge E420s

    Read the article

  • execute a shell script when USB is connected

    - by Null pointer
    I am working on an application which deals with all kinds of USB storage devices(such as taking backup, updating DataLogFile etc) My problem is : I want to write a shell script which is stored in this USB drive(As usb is at center of my project so USB is going to be same but PC's will change) AND this script should be executed as soon as the USB drive is connected to my Linux system.I will not need any kind of "root" or "sudo" permissions for other tasks which I am going to do in this shell script.

    Read the article

  • Writing own Unix shell in C - Problems with PATH and execv

    - by user1287523
    I'm writing my own shell in C. It needs to be able to display the users current directory, execute commands based on the full path (must use execv), and allow the user to change the directory with cd. This IS homework. The teacher only gave us a basic primer on C and a very brief skeleton on how the program should work. Since I'm not one to give up easily I've been researching how to do this for three days, but now I'm stumped. This is what I have so far: Displays the user's username, computername, and current directory (defaults to home directory). Prompts the user for input, and gets the input Splits the user's input by " " into an array of arguments Splits the environment variable PATH by ":" into an array of tokens I'm not sure how to proceed from here. I know I've got to use the execv command but in my research on google I haven't really found an example I understand. For instance, if the command is bin/ls, how does execv know the display all files/folders from the home directory? How do I tell the system I changed the directory? I've been using this site a lot which has been helpful: http://linuxgazette.net/111/ramankutty.html but again, I'm stumped. Thanks for your help. Let me know if I should post some of my existing code, I'm wasn't sure if it was necessary though.

    Read the article

  • Mac OS X = UNIX? [closed]

    - by lee
    Possible Duplicate: How Unix is Mac OS X? People always said ubuntu, linux is UNIX based OS, then how about mac os x? from mac os x terminal i can see most of the unix command are available does it mean mac os also built on UNIX?

    Read the article

  • Sourcing a shell script, while running with sudo

    - by WishCow
    I would like to write a shell script that sets up a mercurial repository, and allow all users in the group "developers" to execute this script. The script is owned by the user "hg", and works fine when ran. The problem comes when I try to run it with another user, using sudo, the execution halts with a "permission denied" error, when it tries to source another file. The script file in question: create_repo.sh #!/bin/bash source colors.sh REPOROOT="/srv/repository/mercurial/" ... rest of the script .... Permissions of create_repo.sh, and colors.sh: -rwxr--r-- 1 hg hg 551 2011-01-07 10:20 colors.sh -rwxr--r-- 1 hg hg 1137 2011-01-07 11:08 create_repo.sh Sudoers setup: %developer ALL = (hg) NOPASSWD: /home/hg/scripts/create_repo.sh What I'm trying to run: user@nebu:~$ id uid=1000(user) gid=1000(user) groups=4(adm),20(dialout),24(cdrom),46(plugdev),105(lpadmin),113(sambashare),116(admin),1000(user),1001(developer) user@nebu:~$ sudo -l Matching Defaults entries for user on this host: env_reset User user may run the following commands on this host: (ALL) ALL (hg) NOPASSWD: /home/hg/scripts/create_repo.sh user@nebu:~$ sudo -u hg /home/hg/scripts/create_repo.sh /home/hg/scripts/create_repo.sh: line 3: colors.sh: Permission denied So the script is executed, but halts when it tries to include the other script. I have also tried using: user@nebu:~$ sudo -u hg /bin/bash /home/hg/scripts/create_repo.sh Which gives the same result. What is the correct way to include another shell script, if the script may be ran with a different user, through sudo?

    Read the article

  • 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

  • How to manipulate a string, variable in shell

    - by user558134
    Hei everyone! I have this variable in shell containing paths separated by a space: LINE="/path/to/manipulate1 /path/to/manipulate2" I want to add additional path string in the beginning of the string and as well right after the space so that the variable will have the result something like this: LINE="/additional/path1/to/path/to/manipulate1 additional/path2/to/path/to/manipulate2" Any help appreciated Thanks in advance

    Read the article

  • Trying to test space in filesystem on Unix

    - by Buzkie
    I need to check if I Filesystem exists, and if it does exist there is 300 MB of space in it. What I have so far: if [ "$(df -m /opt/IBM | grep -vE '^Filesystem' | awk '{print ($3)}')" < "300" ] then echo "not enough space in the target filesystem" exit 1 fi This throws an error. I don't really know what I'm doing in shell. My highest priority is AIX but I'm trying to get it to work for HP and Sun too. Please help. -Alex

    Read the article

  • Identifying and removing null characters in UNIX

    - by fahdshariff
    I have a text file containing unwanted null characters. When I try to view it in I see ^@ symbols, interleaved in normal text. How can I: a) Identify which lines in the file contains null characters? I have tried grepping for \0 and \x0, but this did not work. b) Remove the null characters? Running strings on the file cleaned it up, but I'm just wondering if this is the best way? Thanks

    Read the article

  • script unable to find directories/files when running from qsub cluster script

    - by user248237
    I'm calling several unix commands and python on a python script from a qsub shell script, meant to run on a cluster. The trouble is that when the script executes, something seems to go awry in the shell, so that directories and files that exist are not found. For example, in the .out output files of qsub I see the following errors: cd: /valid/dir/name: No such file or directory python valid/script/name.py python: can't open file 'valid/script/name.py': [Errno 2] No such file or directory so the script cannot cd into a dir that definitely exist. Similarly, calling python on a python script that definitely exists yields an error. any idea what might be going wrong here, or how I could try to debug this? thanks very much.

    Read the article

  • Shell Script Sequencing with Rake

    - by Haseeb Khan
    Hi All, I am working on a rake utility and want to implement something mentioned below: There are some shell commands in a sequence in my Rake file. What I want is that the sequence should wait for the previous command to finish processing before it moves to the next one. sh "git commit -m \"#{args.commit_message}\"" do |ok, res| # Do some processing end sh "git push heroku master" So, in the above example what I want is that sh "git push heroku master" shouldn't be executed until the processing in the sh "git commit -m \"#{args.commit_message}\"" do |ok, res| # Do some processing end is completed. Also another nice to have would be that if I can store the output of the shell command in a Ruby variable so it can be used in further manipulation if required. Looking forward to a reply from the fellow community member shortly. Thanks in advance.

    Read the article

  • Find all words containing characters in UNIX

    - by fahdshariff
    Given a word W, I want to find all words containing the letters in W from /usr/dict/words. For example, "bat" should return "bat" and "tab" (but not "table"). Here is one solution which involves sorting the input word and matching: word=$1 sortedWord=`echo $word | grep -o . | sort | tr -d '\n'` while read line do sortedLine=`echo $line | grep -o . | sort | tr -d '\n'` if [ "$sortedWord" == "$sortedLine" ] then echo $line fi done < /usr/dict/words Is there a better way? I'd prefer using basic commands (instead of perl/awk etc), but all solutions are welcome! To clarify, I want to find all permutations of the original word. Addition or deletion of characters is not allowed.

    Read the article

  • Identifying and removing null characters in UNIX

    - by fahdshariff
    I have a text file containing unwanted null characters. When I try to view it in I see ^@ symbols, interleaved in normal text. How can I: a) Identify which lines in the file contains null characters? I have tried grepping for \0 and \x0, but this did not work. b) Remove the null characters? Running strings on the file cleaned it up, but I'm just wondering if this is the best way? Thanks

    Read the article

  • Automatic exit from bash shell script on error

    - by radman
    Hi, I've been writing some shell script and I would find it useful if there was the ability to halt the execution of said shell script if any of the commands failed. See below for an example: #!/bin/bash cd some_dir ./configure --some-flags make make install So in this case if the script can't change to the indicated directory then it would certainly not want to do a ./configure afterward it fails. Now I'm well aware that I could have an if check for each command (which I think is a hopeless solution), but is there a global setting to make the script exit if one of the commands fails?

    Read the article

  • UNIX sort: Sorting something from the clipboard

    - by Iker Jimenez
    The other day I saw a colleague of mine using sort to sort a number of lines he copied from a text file. I've been trying to reproduce it myself and I cannot seem to find how. The requirements are as follow: Use sort from command line, plus whatever else you need to add to configure input Paste the text to be sorted from the clipboard Get the sorted result in the console

    Read the article

  • unix process id

    - by swathi
    how to a Write a script that runs a 5 instances of a child process in the background (at a gap of 5 seconds) and do a continuous check to see if any of the child process is completed it starts another instance of the same process till the child process has executed 20 instances.

    Read the article

  • Is Unix not a PC Operating System?

    - by Corelgott
    I am doing my Bachelor at a university. In a written assignment the professor posted the task: "Name 3 PC-Operating Systems". Well, I went on an included a variety of OS (Linux, Windows, OSx) including Unix & Solaris. Today I recieved a mail from my prof saying: Unix is not a PC-Operating System. Many Unix-variants are not PC-hardware compatible (like AIX & HP-UX. About Solaris: there was one PC-compatible version...) I am kind of suprised: Even if may Unix-variants are Power-PC and different bit-order – Those don't stop being PCs now, right? The question was given in a written assigment! It was not a question that came up during lecture! Due to the original task being in German, I'll include it just to make sure nobody suspects an error in the translation. Frage: Nennen Sie 3 PC-Betriebssysteme. Antwort: Unix ist kein PC-Betriebssystem, viele Unix-Varianten sind nicht auf PC-Hardware lauffähig (AIX, HP-UX). Von Solaris gab es mal eine PC-Variante.

    Read the article

  • Is Unix a PC Operating system?

    - by Corelgott
    I have got kind of a stupid question. I am doing my bachelor at a university. In a wirtten assigment a prof posted the task: "Name 3 PC-Operating Systems:" Well, I went on an included a variety of OS (Linux, Windows, Osx) including Unix & Solaris. Today I recieved a mail from my prof saying: "Unix is not a PC-Operating System. Many Unix-Variants are not PC-Hardware-Compatible (like AIX & HP-UX. About Solaris: there was one PC-Compatible version...)" I am kind of suprised: Even if may Unix-Variants are Power-PC and different bit-order – Those don't stop beeing PCs right now? The question was given in a written assigment! It was not a question that came up during lecture! Due to the original postest task being in German, I'll include it just to make sure, that nobody suspects an error in the translation... "Nennen Sie 3 PC-Betriebssysteme:" Response / Antwort: "Unix ist kein PC-Betriebssystem, viele Unix-Varianten sind nicht auf PC-Hardware lauffähig (AIX, HP-UX). Von Solaris gab es mal eine PC-Variante." Anybody got something on that? Thx & Cheers Corelgott

    Read the article

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