[Solved] Bash: Want to supress output but still have it recorded

I'd like to run a test, have it known but the output not to show.  How do I do this?
[[ -z $(ls -1 screencast-[0-9][0-9][0-9][0-9]*) ]] && echo hi
If I send it to /dev/null it doesn't get recorded, what do I do?
Last edited by Gen2ly (2012-08-23 14:08:00)

Send it to a file - or a variable.
*think I must be missing something*
Oh, after reading better I think I get it, though the answer would be the same.  Do you only want the return code of the command used for the test while other output is ignored?  Various options depending on your need:
commmand >/dev/null
[[ $? -eq 0 ]] && conditionally-executed-command
[[ `command >/dev/null` ]] && conditionally-executed-command
command > ~/my.log
VARIABLE_LOG=$(command)
Last edited by Trilby (2012-08-23 12:46:26)

Similar Messages

  • I have huge lag with Safari's Reading List using a rMBP. I have probably 80 articles saved, which is likely the cause of the lag. Is there any way to export that list of articles so as to be able to delete them from Reading List but still have a record?

    I have huge lag with Safari's Reading List using a rMBP. I have probably 80 articles saved, which is likely the cause of the lag. Is there any way to export that list of articles so as to be able to delete them from Reading List but still have a record of the articles I intend to read?

    I'm currently dealing with this issue myself, except that my rMBP has NO articles in the reading list.  It's a brand new rMBP too, purchased just this week, with the 2.6 Ghz Processor & 16GB of RAM.
    Let's see what we can find.  I may just take it back to the Apple Store.

  • [Solved] Constructed a multi-purpose prompt but still have 1 issue

    I didn't think re-opening my old thread was a good idea so I'm starting  new one to address 1 issue I have left to conquer.
    With some help from JWR I have built my prompt and it works for users and root logged into a local machine.  Logging into a remote machine does change my user's prompt by appending :ssh: to it.  However, as the root user logged into a remote machine, which should have the  :ssh: appended to it, doesn't work.  By that I mean that root logged in to a remote system doesn't get the correct prompt.  I want the prompt to look like this for root:
    :root: ~ :ssh:
    Instead I get this prompt which lacks the word "root" in it:
    : ~ ::ssh:
    This is my prompt script so far and I'd really appreciate some help to nail down this glitch. 
    The script for root and user are identical apart from having a different prompt uncommented.
    ### Other prompt styles to use later
    This is root's current script:
    ### A PS1 for each computer is on the respective lines in this order:
    ### ### White Yunzi / Silver Yunzi / Pink Yunzi / Rainbow EeePC
    if [[ -n $SSH_CLIENT ]]; then
    # PS1='\[\e[0;37m\]: \[\e[1;32m\]\W\[\e[0;37m\] :\[\e[0;37m\]:\[\e[1;33m\]ssh\[\e[m\]\[\e[0;37m\]: ' # WY SSH
    PS1='\[\e[0;37m\]: \[\e[1;33m\]\W\[\e[0;37m\] :\[\e[0;37m\]:\[\e[1;33m\]ssh\[\e[m\]\[\e[0;37m\]: ' # SY SSH
    # PS1='\[\e[0;37m\]: \[\e[1;35m\]\W\[\e[0;37m\] :\[\e[0;37\m]:\[\e[1;33m\]ssh\[\e[m\]\[\e[0;37m\]: ' # PY SSH
    # PS1='\[\e[0;37m\]: \[\e[1;33m\]\W\[\e[0;37m\] :\[\e[0;37m\]:\[\e[1;33m\]ssh\[\e[m\]\[\e[0;37m\]: ' # EeePC SSH
    elif [[ ${EUID} == 0 ]]; then ## :root: ~ :
    # PS1='\[\e[0;37m\]:\[\e[1;32m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;92m\]\W \[\e[0;37m\]:\[\e[m\] \[\e[0;37m\] ' # WY root
    PS1='\[\e[0;37m\]:\[\e[1;34m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;34m\]\W \[\e[0;37m\]:\[\e[m\] \[\e[0;37m\] ' # SY root
    # PS1='\[\e[0;37m\]:\[\e[1;35m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;35m\]\W \[\e[0;37m\]:\[\e[m\] \[\e[0;37m\] ' # PY root
    # PS1='\[\e[0;37m\]:\[\e[1;33m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;33m\]\W \[\e[0;37m\]:\[\e[m\] \[\e[0;37m\] ' # EeePC root
    else ## : ~ :
    # PS1='\[\e[0;37m\]: \[\e[1;32m\]\W\[\e[0;37m\] :\[\e[m\]\[\e[0;37m\] ' # WY user
    PS1='\[\e[0;37m\]: \[\e[1;34m\]\W\[\e[0;37m\] :\[\e[m\]\[\e[0;37m\] ' # SY user
    # PS1='\[\e[0;37m\]: \[\e[1;35m\]\W\[\e[0;37m\] :\[\e[m\]\[\e[0;37\m] ' # PY user
    # PS1='\[\e[0;37m\]: \[\e[1;33m\]\W\[\e[0;37m\] :\[\e[m\]\[\e[0;37m\] ' # EeePC user
    fi
    ## :root: ~ :ssh:
    #PS1='\[\e[0;37m\]:\[\e[1;34m\]\u\[\e[0;37m\]:\[\e[1;34m\] \W \[\e[0;37m\]:\[\e[m\]\[\e[0;37m\]\[\e[1;33m\]ssh\[\e[0;37m\]: ' # SY root
    ## :root:: ~ :ssh:
    #PS1='\[\e[0;37m\]:\[\e[1;34m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;34m\]\W \[\e[0;37m\]:\[\e[m\]\[\e[0;37m\]\[\e[1;33m\]ssh\[\e[0;37m\]: ' # SY root
    ## :root:: ~ ::ssh:
    # PS1='\[\e[0;37m\]:\[\e[1;34m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;34m\]\W\[\e[0;37m\] :\[\e[m\]:\[\e[m\]\[\e[0;37m\]\[\e[1;33m\]ssh\[\e[0;37m\]: ' # SY root
    Last edited by MoonSwan (2014-11-19 09:23:02)

    jasonwryan wrote:So it works for root locally, just not when you SSH in as root or change to root in an SSH session?
    Yes, you're quite correct.
    jasonwryan wrote:Also, it might help if you remove the commented lines, it is pretty hard to work out what is going on in there...
    I agree and I found a bunch of \'s that I missed.  Sorry about that!
    Here's the config stripped of extraneous junk:
    if [[ -n $SSH_CLIENT ]]; then
    PS1='\[\e[0;37m\]: \[\e[1;32m\]\W\[\e[0;37m\] :\[\e[0;37m\]:\[\e[1;33m\]ssh\[\e[m\]\[\e[0;37m\]: ' # WY SSH
    elif [[ ${EUID} == 0 ]]; then ## :root: ~ :
    PS1='\[\e[0;37m\]:\[\e[1;32m\]\u\[\e[0;37m\]:\[\e[0;37m\]: \[\e[1;92m\]\W \[\e[0;37m\]:\[\e[m\] \[\e[0;37m\] ' # WY root
    else
    PS1='\[\e[0;37m\]: \[\e[1;32m\]\W\[\e[0;37m\] :\[\e[m\]\[\e[0;37m\] ' # WY user
    fi
    Edit:  stripped out two comments I'd missed earlier.
    Last edited by MoonSwan (2014-11-19 08:27:27)

  • Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files but still have them on the TC for future reference..

    Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files on iMac 20inch but still have them on the TC for future reference..eg some movies on iTunes. I want to directly save them on the drive so I can delete them from iTunes and gain some storage. (Ps on iMac 20 inch (it's almost full - 320 GB) when I enter time machine, a tab comes up on finder which reads "Time Machine backups" it's able to be ejected like a disc or a connected device. On the iMac 20 inch, I dragged some files onto there as if using it like a hard drive. Is this the correct method? Then I went to my 27inch iMac and saw the "Time Machine Backups" hoping to see the files I dragged from the 20inch iMac. But the files were not there except a folder that said "Backups.backupdb". Can someone help me?

    It's not a good idea to use a network disk for both Time Machine backups and other things.  By design Time Machine will eventually consume all the space on its output disk, which will then cause problem for your other files.  I'd store those other files on an external disk connected to the Time Capsule.  The problem with that is that Time Machine will only back up files that are local to your Mac.  That means that you'll only have one copy of the files on or attached to your Time Capsule.
    By the way, you've been misled by poor field labeling on this forum into typing a large part of your message into the field intended for the subject.  In the future just type a short summary of your post into that field and type the whole message into the field below that.

  • My computer will not let me click the box in iTunes where it says "sync only checked music and videos." So i cant unsync songs that i don't want on my iPod but still want in my iTunes. HELP?!

    My computer will not let me click the box in iTunes where it says "sync only checked music and videos." So i cant unsync songs that i don't want on my iPod but still want in my iTunes. HELP?!

    These are your options:
    1. Restore the iPhoto library from the most recent backup that predates the issue.
              Advantages: Always works, if library damage is causing the problem and the backup is intact.
              Disadvantages: Impossible if you don't have a backup. All changes made since the backup are lost.
    2. Repair or rebuild the library. Be sure to back it up first.
              Advantages: May solve the problem with no loss of data.
              Disadvantages: May fail. May take a long time if the library is large.
    3. Scavenge the library with a third-party application called "iPhoto Library Manager," which you can find in a web search. From the application's menu bar (not the iPhoto menu bar), select Library ▹ Rebuild.
              Advantages: All images should be preserved.
              Disadvantages: All books, calendars, and slideshows will be lost.

  • I want to set-up a network with our current two laptops for a family of 4 w/unique 4 profiles. I'd like everyone to be agnostic about which computer to log into and use but still have private docs and apps (i.e.mail/facebook). How best can I do this?

    I want to set-up a network with our current two laptops for a family of 4 with unique 4 profiles.  I'd like everyone to be agnostic about which computer to log into and use but still have private docs and apps (i.e. mail/facebook).  How best can I do this?

    iCloud Photo Sharing FAQ - Apple Support
    http://www.fatcatsoftware.com/iplm/Help/accessing%20an%20iphoto%20library%20on%2 0another%20mac.html

  • HT1386 I am re-building my iTunes library, but still have all the content on my iPod Classic.  I have just downloaded some songs from the store and want to add them to the iPod, BUT when i attempt this the message asks if I want to delete all content on t

    I am rebuilding my iTunes library, but still have all the old content on my iPod Classic.  I have just download some songs from the iStore and want to add them to the iPod, BUT when I try to sync it asks if I want to delete all content from the iPod and add only the material that I have just downloaded from the Store.  I do not want to lose my old content, because it is very extensive.

    You are trying to sync to other than the one iTunes library you can sync to. You can copy music from multiple library/computer if you use the manual method of syncing. That method is described here
    iTunes: Syncing media content to iOS devices and iPod
    If you want to make this computer/iTunes library your syncing computer/library you have to restore the iPod on this computer/library. Restoring erases the iPod.
    You can redownload most iTunes purchases by:
    iTunes: Syncing media content to iOS devices and iPod
    To copy other music to the computer see:
    Recovering your iTunes library from your iPod or iOS device: Apple Support Communities
    BTW this is the iPod touch forum

  • My dad and i have the same icloud id,when i updated the software (to ios 8.1.3) i have my dad´s photos on my iphone.And want my photos back (i tried restoring my phone from the last backup) but still have my dad´s photos on my device.

    My dad and i,have the same icloud id,when i updated the software (to ios 8.1.3) i have my dad´s photos on my iphone.And want my photos back (i tried by restoring my phone from my last backup)but still have my dad´s photos in my device

    And that's exactly the problem, because everyone should have their own account for iCloud. You can share an Apple ID for iTunes & App Store purchases, but you shouldn't do that for iCloud (Mail, Calendar, Contacts etc. ... ...and Photos). The problem of using the same account together could mean that only your dad's photos were stored.

  • I want to buy a appleTV but still have a iphone 3gs. Will everything work as with a iphone4?

    I really want to buy a appletv but still have a iphone 3gs. I want to know if everything will work the same as if using it with a iphone 4 (photos, videos, music etc.)

    Speed might not be optimal, but you'd be best using home sharing from a computer and controlling your Apple TV with the Remote app anyway.
    The direct answer to your question is yes, it will work.

  • How can I "archive" mails in Mail App to another internal drive/partition to save space but still have it searchable in spotlight (and preferably visible, searchable, draggable in Mail App)?

    How can I "archive" mails in Mail App to another internal drive/partition to save space but still have it searchable in spotlight (and preferably visible, searchable, draggable in Mail App)?
    Background:
    I am using Mountain Lion and Mail App and running out of space on my small primary SSD drive (where I keep OS, apps, key user preferences/data and mail for speed). The mail data is the big variable (many GBs) and I want to "archive"/move some of the old mail to my 2nd drive inside the Mac. But I still want it searchable inside spotlight and preferably even inside Mail too. And I'd like to be able to still drag and drop old mails into this archive folder.
    What I've tried that seems to work:
    This seemed to work:
    1. Move the archive folder/mailbox to the 2nd drive/partition/folder (don't delete anything inside Mail App)
    2. Create a symbolic link from its new location to the original/old location
    This seems to work, it looks as "normal" and as if nothing happened inside Mail App but the folder now resides elsewhere and seems searchable etc. But I'm not sure that once caches refresh or over time with updates etc if stuff will break horribly or corrupt.
    Is that the right way to "archive" mails in Mail App to another internal drive/partition to save space but still have it searchable in spotlight and visible, searchable, draggable in Mail App?
    Thanks in advance!
    Cheers,
    Daniel

    I'm having a similar but slightly different problem. My company just migrated to Gmail, and it's saving mail drafts every 30 seconds into my Trash folder.
    I unchecked the "Show in IMAP" preference in the Gmail settings, but my Drafts folder completely disappeared. I went back and checked it and the folder reappeared (with my drafts still in there).
    I like the idea if starting an email on my laptop and having the option of finishing it on my iPhone or iPad, so only saving Drafts locally would not be ideal.

  • HT204150 i have deleted all contacts in icloud but still have them on my iphone (which is backed up as well to iTunes) how can i restore the iphone data to the iCloud so it will resend it to my mac book and iPad?

    i have deleted all contacts in icloud but still have them on my iphone (which is backed up as well to iTunes) how can i restore the iphone data to the iCloud so it will resend it to my mac book and iPad? I have switched my iphone to airplane mode so it is not connected to the internet and so icloud can not wipe it at the moment.
    thanks roy

    There's a menu choice (I think under "Files") that lets you sync purchased items on a device back to itunes.  Look for that.
    iCloud does not store music.  If you want to do that you'd have to subscribe to itunes Match, but to get music to the match servers, you need the music in the itunes library on your computer.

  • Under music my artists tab disappeared but still have albums, songs etc how to get artists tab back?

    Under music the artists tab disappeared but still have albums, songs etc. 
    how to  get artists tab back?

    Hi Gary gar,
    Welcome to the Apple Support Communities!
    It sounds like the options at the bottom of the Music application may have been edited. You can click the More section on the far right, then choose Edit in the top right. You can then drag any options you want to that bottom bar and rearrange them.
    Browse and play - iPhone
    http://help.apple.com/iphone/7/#/iph3cf21a82
    Tired of tapping More? To rearrange the buttons, tap More, then tap Edit and drag a button onto the one you want to replace.
    Have a great day,
    Joe

  • Can I upload music from iPod to iTunes? My music has disappeared from my iTunes account, but still have it on iPod.

    Music on my iTunes account has disappeared, but still have it on my older iPod; want to upload it to iTunes, but when I hook up to computer, iTunes wants to overwrite the iPod.  I fear I'll lose it all.  Any help?

    Hey blite923,
    Thanks for the question. If these are purchased songs, you can transfer purchases from your iPod to your computer without syncing:
    Re-download or transfer your iTunes Store purchases from an iPhone, iPad or iPod to a computer - Apple Support
    http://support.apple.com/en-us/HT1848
    Transfer your purchases to your computer
    Before you transfer your purchases, make sure that your computer is authorized with the same Apple ID account you used to make the purchases. Learn how to authorize your computer using iTunes.
    If you bought the iTunes Store content on your device using multiple Apple ID accounts, you'll need to authorize the computer for each one.
    To transfer purchases from your device to a computer:
    Connect your device to the computer. Wait for its icon to appear in iTunes.
    Go to File > Devices. If you're using iTunes for Windows and can't see the menu bar, learn how to turn on iTunes menus in Windows.
    Choose Transfer Purchases from [device name].
    ​​This feature works only for content bought from the iTunes Store. Any items that you imported from audio CDs or received from other sources won't copy from your device to the iTunes library. However, all podcasts from your device's Podcasts app and copies of all PDFs and books from your device's iBooks app will transfer to the computer. Learn how to transfer media to your iTunes library.
    Thanks,
    Matt M.

  • I have a certified cable that came in with my iPhone5. Since I upgraded to iOS7, I've been getting the "This cable is not certified..." but still have my phone charged. Now, it just don't charge anymore. Any solutions? I made sure it has no debris.

    I have a certified cable that came in with my iPhone5. Since I upgraded to iOS7, I've been getting the "This cable is not certified..." but still have my phone charged. Now, it just don't charge anymore. Any solutions? I made sure it has no debris. Tried all the possible solutions found here but no no no. It's a new charger I don't want to buy anymore it'll cost me a lot

    restore your iPhone with back up and then if required as new

  • I want to know if i still have warranty on my phone?

    When i put in the charger it doesnt charge. The actual charger works because i tried it on my brothers phone it work but it doesnt work on my phone. I want to know if i still have warranty on my phone.

    Type your serial number on this Apple Support page:
    https://selfsolve.apple.com/agreementWarrantyDynamic.do

Maybe you are looking for

  • Arranging white text on a black background

    I'm having problems in Illustrator CC being able to have white text be on top of a black shape. I've select the black shape and arranged it for it to be in the back. However, it still appears as the top of my white text. Thanks for any help - I'm an

  • Crystal Report failed because a free license could not be obtained

    My question is about Crystal Report Standard (v. 10) and Crystal Report Professional (v.10) Trying to print labels on from my application using Crystal Report Standard Edition (v. 10) and I am getting the follow error.  And it doesnu2019t print any m

  • Error in xml format

    hi all, i am using Forms [32 Bit] Version 6.0.8.24.1 (Production) Oracle Database 10g Release 10.2.0.1.0 - Production i have to generate a file in xml format. but i between the file i am getting the following error The XML page cannot be displayed Ca

  • Checksum wrong in Mathematica 8

    Hi everybody! I'd like to use Mathematica 8 on my x86_64 desktop but the installation goes wrong from the first step: ./Mathematica_8.0.1_LINUX.sh Mathematica Secured 8.0.1 for LINUX Installer Archive Verifying archive integrity. Error in MD5 checksu

  • [BUG] JDeveloper performance bug

    Hi, I am working on ADF faces and hit a performance bug: When displaying the "design view" of a jsf page, Jdeveloper hangs for more than 15 minutes (thats why it is a bug, not a simple issue), then it displays it correctly. Host is a P4 3Ghz with 2GB