Search Results

Search found 6758 results on 271 pages for 'shell exec'.

Page 60/271 | < Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >

  • Default prolog for all ZSH scripts?

    - by Igor Spasic
    I have a file that contains several helper functions, meant to be used only in other ZSH scripts. I do not want them to be loaded with my profile. To make these functions available in my script, I would need to source this file. Is it somehow possible to have automatic prolog script (or pre-script) loaded before all my ZSH scripts? My current idea is to alias -s zsh extension to custom function that those all this for me: concatenate prolog file and current script calls zsh with such modified input but for now I am somehow not able to do this (haven't sleep for almost a day). Please, does anyone have a working solution?

    Read the article

  • Write STDOUT & STDERR to a logfile, also write STDERR to screen

    - by Stefan Lasiewski
    I would like to run several commands, and capture all output to a logfile. I also want to print any errors to the screen (or optionally mail the output to someone). Here's an example. The following command will run three commands, and will write all output (STDOUT and STDERR) into a single logfile. { command1 && command2 && command3 ; } > logfile.log 2>&1 Here is what I want to do with the output of these commands: STDERR and STDOUT for all commands goes to a logfile, in case I need it later--- I usually won't look in here unless there are problems. Print STDERR to the screen (or optionally, pipe to /bin/mail), so that any error stands out and doesn't get ignored. It would be nice if the return codes were still usable, so that I could do some error handling. Maybe I want to send email if there was an error, like this: { command1 && command2 && command3 ; } logfile.log 2&1 || mailx -s "There was an error" [email protected] The problem I run into is that STDERR loses context during I/O redirection. A '2&1' will convert STDERR into STDOUT, and therefore I cannot view errors if I do 2 error.log Here are a couple juicier examples. Let's pretend that I am running some familiar build commands, but I don't want the entire build to stop just because of one error so I use the '--keep-going' flag. { ./configure && make --keep-going && make install ; } > build.log 2>&1 Or, here's a simple (And perhaps sloppy) build and deploy script, which will keep going in the event of an error. { ./configure && make --keep-going && make install && rsync -av --keep-going /foo devhost:/foo} > build-and-deploy.log 2>&1 I think what I want involves some sort of Bash I/O Redirection, but I can't figure this out.

    Read the article

  • What is the difference between bash and sh

    - by Saif Bechan
    In using i see 2 types of code #!/usr/bin/sh and #!/user/bin/bash I have Googled this and the opinions vary a lot. The explanation I have seen on most websites is that sh is older than bash, and that there is no real difference. Does someone know the difference between these and can give a practical example when to use either one of them. I highly doubt that there is no real difference, because then having to things that do the exact same thing would be just

    Read the article

  • Install a Program from ZIP File on Ubuntu Not Found Using Aptitude

    - by nicorellius
    I have a specific program that I use often on Windows and Mac, but today need to install it on a Linux machine. I downloaded the ZIP file from the vendors website, unzipped it to the Desktop and now I have an SH file. I tried running this file from the command line as root, but the permissions were denied. How can I install this program on Linux? I know it's possible because I have heard of it being done. I just don't have the experience with Linux I need to get it done. To which directory should I install it? I tried the install command but it needed a directory to which to install.

    Read the article

  • How to power a serial port under linux?

    - by Lex
    I got a serial to ethernet device connected to a Serial (COM) port on a Linux machine (debian etch), I connected it correctly but it did not power up, I suppose I need to power the device port, anyone knows how to power it under linux? Thankyou in advance.

    Read the article

  • Ruby: Widely Distributed?

    - by Yar
    While I know it's not part of the Posix standard, but how widely distributed is Ruby on Linux, Unix and other *nix's? I ask because I loathe sh and use Ruby whenever I can on Ubuntu and OSX, but I don't want to get too locked in to 'strange' solutions.

    Read the article

  • rc.local is not executed on bootup ubuntu

    - by Alexander
    Im on Ubuntu 10.04. I want to execute script on system boot. I added it to rc.local. If I execute rc.local manually it works fine. If I boot system in recovery mode(2nd string in boot menu) it also works fine. But if I boot normally it is not executed. However i added sleep 20 to my script and there is a pause at the end of boot process, but nothing more is executed. Thanks I think, it soesnt depend on contents of the script but anyway #!/bin/sh -e sleep 20 sudo service ssh start su -c 'service pgsql start' postgres sudo svnserve -d su -c 'hamachi start' root su -c 'hamachi login' root exit 0

    Read the article

  • Linux: using find to locate files older than <date>

    - by DrStalker
    find has good support for finding files the more modified less than X days ago, but how can I use find to locate all files modified after a certain date? I can't find anything in the find man page to do this, only to compare against another files time or to check for differences between created time and now. Is making a file with the desired time and comparing against that the only way to do this?

    Read the article

  • In *nix, how to determine which filesystem a particular file is on?

    - by smokris
    In a generic, modern unix environment (say, GNU/Linux, GNU/Solaris, or Mac OS X), is there a good way to determine which mountpoint and filesystem-type a particular absolute file path is on? I suppose I could execute the mount command and manually parse the output of that and string-compare it with my file path, but before I do that I'm wondering if there's a more elegant way. I'm developing a BASH script that makes use of extended attributes, and want to make it Do The Right Thing (to the small extent that it is possible) for a variety of filesystems and host environments.

    Read the article

  • How to make new file permission inherit from the parent directory?

    - by Wai Yip Tung
    I have a directory called data. Then I am running a script under the user id 'robot'. robot writes to the data directory and update files inside. The idea is data is open for both me and robot to update. So I setup the permission and owner group like this drwxrwxr-x 2 me robot-grp 4096 Jun 11 20:50 data where both me and robot belongs to the 'robot-grp'. I change the permission and the owner group recursively like the parent directory. I regularly upload new files into the data directory using rsync. Unfortunately, new files uploaded does not inherit the parent directory's permission as I hope. Instead it looks like this -rw-r--r-- 1 me users 6 Jun 11 20:50 new-file.txt When robot tries to update new-file.txt, it fails due to lack of file permission. I'm not sure if setting umask helps. In anycase the new files does not really follow it. $ umask -S u=rwx,g=rx,o=rx I'm often confounded by Unix file permission. Do I even have a right plan? I'm using Debian lenny.

    Read the article

  • Not able to find scripts present in /etc/profile.d directory [on hold]

    - by priya
    I am using Red Hat Linux 6.0 ... using davinchi board. I have to change system clock resolution so I am changing (HZ) env var. For this I have written script so that I can change HZ = 1000 n insert that script in /etc/profile.d and write code for loop in /etc/profile so that while running as usual /etc/profile can load the scripts present in /etc/profile.d. But when I am logging into the system at root level then showing error as "-bash: ./etc/profile.d/resolution.sh(my script name): No such file or directory Also here why it is showing ./etc and not /etc . Is something related to that?? Also I tried to add script in /etc/init.d but still no change in value of HZ takes place. Please tell where to change so that this env var can get changed. The script(resolution.sh) written has :- #!/bin/bash export HZ=1000 The content of /etc/profile which I entered is: if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then .$i fi done unset i fi And the output of grep command is -rw-r--r-- 1 root root 535 Feb 4 2004 profile -rwxr-xr-x 2 root root 4096 Feb 2 2004 profile.d

    Read the article

  • What is the EGG environment variable?

    - by Randall
    A user on our (openSuSE) linux systems attempted to run sudo, and triggered an alert. He has the environment variable EGG set - EGG=UH211åH1ÒH»ÿ/bin/shHÁSH211çH1ÀPWH211æ°;^O^Ej^A_j<X^O^EÉÃÿ This looks unusual to say the least. Is EGG a legitimate environment variable? (I've found some references to PYTHON_EGG_CACHE - could be related? But that environment variable isn't set for this user). If it's legit, then I imagine this group has the best chance of recognizing it. Or, given the embedded /bin/sh in the string above, does anyone recognize this as an exploit fingerprint? It wouldn't be the first time we had a cracked account (sigh).

    Read the article

  • Can you get to a command line on the iPhone?

    - by Ethan
    I'm not even sure why I'd want to do this. I guess I'm just curious. Is there a way to get to some kind console, command line, or text-based UI on the iPhone? I'm referring to accessing the iPhone system itself, poking around in the directories, opening files in something akin to vi, that sort of thing.

    Read the article

  • Ctrl-C behavior in gnome-terminal

    - by sev
    I have installed Ubuntu 10.04. It works fine, but when I press Ctrl-C in gnome-terminal I get: user@desktop:~$ ^C user@desktop:~$ ^C user@desktop:~$ In Ubuntu 9.04 (I did have it before) it was so: user@desktop:~$ user@desktop:~$ user@desktop:~$ Who knows how can I fix this?

    Read the article

  • Silent and scripted install of CPAN and Perl modules?

    - by Mikael Grönfelt
    I need to install CPAN and some Perl modules automatically in a Scientific Linux (RHEL) installation script. Unfortunately the specific modules I want (at least one of them) cannot be found as RPM:s as far as I've seen. So I need to install CPAN, configure it automatically (or with a config file) and then install the wanted modules (including dependencies) automatically as well. This doesn't seem like a very unusual requirement, but I haven't seen any really good documentation on this. The problem is that whenever CPAN is launched for the first time an interactive configuration runs. Can this be skipped somehow? And how do I launch module installations directly from the command line?

    Read the article

  • Figure out what non-symlink path would be?

    - by David Mackintosh
    On Linux, if I've cd'd around and am now in a directory, is there a way to figure out what the real path to that directory is if I had not used a symbolic link to get there? Consider: $ pwd /home/dave/tmp $ mkdir -p 1/2/3/4/5 $ ln -s 1/2/3/4/5 5 $ cd 5 $ pwd /home/dave/tmp/5 Or: $ pwd /home/dave/tmp $ mkdir -p 1/2/3/4/5 $ ln -s 1/2/3/4 4 $ cd 4/5 $ pwd /home/dave/tmp/4/5 Is there any way to figure out that /home/dave/tmp/5 is really /home/dave/1/2/3/4/5 ?

    Read the article

  • tcsh : path of sourced file

    - by Charles
    I am sourcing a file under tcsh. This file could be anywhere on the filesystem. How can I retrieve the path of my sourced file ? $0 won't work : I don't execute the file, I source it. Many thanks !

    Read the article

  • What is the fastest way to reload history commands begin with certain characters in linux?

    - by gerry
    In Dos we can input the first several characters to filter command history and find proper one rapidly. But how to do the same thing in Linux ? for example when I am testing a local server: cd sudo /etc/init.d/vsftpd start wget ... ls emacs ... sudo /etc/init.d/vsftpd restart sudo /etc/init.d/vsftpd stop ... In Dos you can easily type sudo and switch among the three commands beginning with it using arrow keys. But in Linux, is below command the best we can do ? historty | grep sudo I don't like it, because history can easily become a mess, and it also need mouse action.

    Read the article

  • What does export do in BASH?

    - by Chas. Owens
    It is hard to admit, but I have never really understood what exactly export does to an environment variable. I know that if I don't export a variable I sometimes can't see it in child processes, but sometimes it seems like I can. What is really going on when I say export foo=5 and when should I not export a variable?

    Read the article

  • How to remove blank lines in .txt file

    - by Brant
    I want to change text file format as following , but don't know how to do (2) 5. The function of the condenser is to: a) vapourise the liquid refrigerant b) change high pressure refrigerant vapour to liquid c) pressurise low pressure refrigerant vapour d) vent off vapourised refrigerant e) lower the liquid refrigerant pressure (2) 6. One tonne of refrigeration is: a) 13958 kJ per day b) 100 kJ per minute c) 233 kJ per minute d) 13958 J per hour e) 335 J per second (2) 5. The function of the condenser is to: a) vapourise the liquid refrigerant b) change high pressure refrigerant vapour to liquid c) pressurise low pressure refrigerant vapour d) vent off vapourised refrigerant e) lower the liquid refrigerant pressure (2) 6. One tonne of refrigeration is: a) 13958 kJ per day b) 100 kJ per minute c) 233 kJ per minute d) 13958 J per hour e) 335 J per second

    Read the article

  • Use sed command to replace , appearing between numbers

    - by Saurabh
    I have a CSV file where data are in the following format |001|,|abc,def|,123456,789,|aaa|,|bbb|,444,555,666 I want to replace only those "," that appears between numbers with some other character like say SOH or $ or * other "," appearing in the line should not get replaced i.e. to say I wish to have following output |001|,|abc,def|,123456*789,|aaa|,|bbb|,444*555*666 Can someone please help me with sed command pattern to get the above desired output

    Read the article

  • Script execution flow stopped?

    - by vijay.shad
    Hi all, Now my script is able to start server, But I am still have some problem with my script. When the start server command is executed, the control does not pass the line and does not execute further of that line. Please tell me what is the problem and how can I get smooth execution of the my script.

    Read the article

  • Calculate disk space occupied by many .png files

    - by Alexander Farber
    I have 357 .png files located in different sub dirs of the current dir: settings# find . -name \*.png |wc -l 357 settings# find . -name \*.png | head ./assets/authenticationIcons/audio.png ./assets/authenticationIcons/bbid.png ./assets/authenticationIcons/camera.png ./bin/icons/ca_video_chat.png ./bin/icons/ca_voice_control.png ./bin/icons/ca_vpn.png ./bin/icons/ca_wifi.png Is there a oneliner to calculate the total disk space occupied by them (before I pngcrush them)? I've tried (unsuccessfully): settings# find . -name \*.png | xargs du -s 4 ./assets/support/wifi_locked_icon_white.png 1 ./assets/support/wifi_vpn_icon_connected.png 1 ./assets/support/wi_fi.png 1 ./assets/support/wi_fi_conected.png 8 ./bin/blackberry-tablet-icon.png 2 ./bin/icons/ca_about.png 2 ./bin/icons/ca_accessibility.png 2 ./bin/icons/ca_accounts.png 2 ./bin/icons/ca_airplane_mode.png 2 ./bin/icons/ca_application_permissions.png 1 ./bin/icons/ca_balance.png

    Read the article

< Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >