Bash: script not working even after using shopt

below is script i am trying. I am trying to get the latest modified file in a folder:
#!/bin/bash
shopt -s extglob
name=$(echo *(om[1]))
echo $name
i am expecting filename instead *(om[1]) is echoed. As such the script does not give any error due to using shopt.
i try the command on commandline it gives the filename as output.
% cd other
% echo *(om[1])
mumbai123.txt
why echo *(om[1]) is working on commandline but not in bash script.
Last edited by sant527 (2014-10-02 03:53:53)

sant527 wrote:why echo *(om[1]) is working on commandline but not in bash script.
Are you using zsh as your shell?

Similar Messages

  • Iphone 4 front camera not working even after reboot,resets and restore.

    i am using iphone 4 .I have problem that front camera is not working even after reboot,resets and restore with itunes.I thing there is a hardware problem.
    Now i wont to go apple store for replace the phone because phone is under warranty period.But problem is that i lost the receipt.Will apple store help me without my receipt ?please help me

    If setting up as new device without using the latest backup does not bring the camera function back, get it looked at or serviced by Apple:
    How to back up your data and set up as a new device
    Apple - Support - Service Answer Center

  • Window 10 upgrade. Graphics driver not working even after re-install

    Notebook pavilion DV6 3280.  Just upgraded to Windows 10 and AMD graphics driver not working even after re-install.  What do I do?  Is there another driver not on the HP Website that I should try?

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * You can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • Social App not working even after update from noki...

    nokia n8 social loading feeds.
    My wife and i have the same problem now, only last week she said my phone will not work on facebook the widget on main home screen will not load feeds at all, and the widget is now blank saying refresh all the time, so i linked the phone up to the computer and did a scan for new updates with nokia updater which you can download from nokia site.
    Its now the 4th jan and the phones still will not work even after and update from a socail app,
    nothing , facebook will load after a few pushes, and looks like its loading till it says loading feeds then it says the (wording unable to load news feeds) 

    Uninstall the social app and reboot your phone. Then go to software updates and reinstall from the offering given in the updates. I've uninstalled and reinstalled social twice and it has worked both times.
    blitZkid
    Nokia C7: Running on Nokia Belle
    "If I'm helpful in anyway, a click of appreciation on the star would be nice"

  • The g, h and backspace on my keyboard are not working even after replacing with a new one.

    The g, h and backspace on my keyboard are not working even after replacing with a new one. I have also updated my BIOS still d same. Please help me ASAP.
    ...am waiting for a QIUCK RESPONSE

    How does a usb keyboard attached externally work?
    You might try a "hard reset" where you remove battery and AC charger, hold down power button 20-30 seconds and then reassemble and turn on. Reset BIOS (F10) to default settings, too. 

  • Ipod touch screen not working even after resetting to factory specs

    ipod touch screen not working even after resetting to factory spec.  lock symbol appears at top

    That indicates you have a hardware problem. An appointment at the Genius Bar of an Apple store is in order.

  • Webcam is not working even after I reinstall the system software

    My webcam is not working even after I reinstall the system software.
    My questions are follows:
    Should I bring it to repair or get a external webcam?
    At approximately how much would be cost for repair?
    Which webcam I should get?
    Thank you very much!
    Tian

    Update, I fixed it although it feels more like a workaround. I had to enable the extension in extension manager. That still left a blank panel, but once I closed and reopened the panel I was prompted to login. Seems that closing and reopening the panel is the fix once it is enabled.

  • All iPad buttons are not working even after resetting it (hard, soft and via iTunes).

    All iPad 2 buttons are not working even after I resetting it. I tried both of the hard and soft reset, and even resetting my iPad via iTunes. 
    The volume buttons work after I tried this method : "hold iPad in landscape mode. Push the home button while rotating it to Portrait mode, release it."

    I have the same issue, nothing I did fixed the problem, I would suggest if you can visit apple store and give us your feedback with them.
    for me I can't go to apple store because I don't have any store near me, I will have to wait for 2 months to travel!

  • Why is Adobe SendNow not working anymore (after using Adobe Send)?

    Why is Adobe SendNow not working anymore (after using Adobe Send)?
    Can this be fixed?

    We are concerned that you did not have a positive experience with Adobe Send. Can you share more information about your workflow so we can try to diagnose the problem?
    If you can provide some context on whether you were using the Adobe Send website or the integration with Adobe Reader? Can you share some details on the types of files and approximate sizes you were trying to send to your clients?

  • Permissions will not set, even after using terminal commands?

    Hey,
    I found a thread on here for using the terminal to type in commands for the user permissions and for the PSIX permissions on Leopard (10.5) server.  These commands are supposed to clean the server of all underlying(hidden) permissions that you cant see and then you are supposed to be able to then set the permissions again and finally, to hit "Propagate Permissions" so that all the permissions set for the shared volume then get farmed out to all sub files/folders.  This did not work when I tried it in the terminal, it said "Command not found" even after I typed in the admin password.  Is there anyone out there who can tell me the actual way to fix the old permissions and get new ones set?
    The story is:  We had an old server on a G4 when i first took control of the server, I took the shared hard drive out of the G4 and inserted it into a G5 and started using it with the leopard server.  the permissions did not really need to be set on that volume because they had carried over from the last time they were shared.  But we recently just got a Drobo unit for our server and I recently transferred all the shared files and folders over to the new volume, but ever since I cant get the permissions to farm out to all the stations, it shows me that its done on the server.  But when I go to access the files I am able to delete faculty folders where I had set the permissions to "read only" so I am wondering if there is a streamlined way of going about this or if I should just start from scratch and use all brand new HDD's?
    Please Help!

    Hi ..
    Try the tips mentioned here > Mini-tutorial: Force-deleting stubborn or problematic files in Mac OS X

  • Touchpad does not work even after format - x220t

    Hi there,
    I've had my X220 tablet for about 10 months and it has been great.  For the last month however, the touchpad and touchpoint have become flaky.  When rebooted or coming out of standby, the touchpoint/touchpad often did not work; after resetting a few times, i would work, but then stop working again when the system when into standby mode.
    I thought this was a driver issue, but uninstalling and reinstalling to the newest drivers did nothing.  I have also updated/reset the BIOS.
    I have more recently have not been able to get the touchpad working at all now and relying on just the touchscreen for input is very frustrating. 
    When Windows 8 CP came out this week, I decided to give the computer a fresh format and reinstall Windows --- maybe that would resolve the issue. No luck.  The touchpoint/touchpad did not work even in Windows 8.
    I read around a bit and have tried disabling JUST the touchpad in the BIOS, and amazingly, the touchpoint will work fine when I do that.  When I disable just the touchpoint or leaving both enabled, neither the touchpad or touchpoint will work.
    As far as I can tell from what I have been able to diagnose, the touchpad is damaged and is causing a conflict with the touchpoint when enabled.  I am not sure of this, but it is my belief now.
    Are there solutions out there for me?  I do have 2 months left on my warranty, but I hope to keep mailing my notebook in for support as a last resort.
    thank you,
    steve

    xyster wrote: 
    When Windows 8 CP came out this week, I decided to give the computer a fresh format and reinstall Windows --- maybe that would resolve the issue. No luck.  The touchpoint/touchpad did not work even in Windows 8.
    If you are ready to reinstall Windows, try this method:
    http://forums.lenovo.com/t5/X-Series-Tablet-ThinkPad-Laptops/My-X220t-Clean-Install-Method/td-p/6612...
    If after that your trackpoint/touchpad still don't work, I think one of them (or both) is defective.
    X220t | i7 | 320GB HDD | 8GB RAM | WIN7 PRO
    IdeaCenter A520 | i5 | 1 TB HDD | 6GB RAM | WIN8.1

  • MacBook Keys not working even after KeyBoard Firmware update

    My friend's sister bought me a MacBook from the US last October. Fortunately, Apple announced the release of Leopard also on the same month and I got a free upgrade to leopard. I installed leopard about 3 months back. My keyboard was working fine when I had Tiger installed. After I installed Leopard, I remember installing a Keyboard firmware update once through the Software Update.
    About two three weeks back, my MacBook started acting wierd. Some keys were not working (mostly 't', 'q', left shift, left command, zero which is not working even now. I couldn't close the last bracket because the key is not working. I am a php programmer and I can't think of living without the closing bracket and zero keys . But most of the keys works on and off.
    After seeing on several sites that it is a problem with firmware, I once again downloaded the firware update, but couldn't install it since the installation wizard says that my system doesn't need it.
    Can someone plz tell me what to do now? Will reinstalling help?
    Thanks in advance.

    The problem persists everytime I restart my system or wake it up from sleep. But each time different keys have problem. I am now downloading update 10.5.4. Can someone plz help me?

  • Accidentally deleted x protect meta.plist and plug in not working even after downloading latest

    Hi all
    Need some help here. It started off like this - after upgrading to mavericks, i had a problem viewing some java stuff. Googled and read somewhere to delete the x protect meta.plist and thus, did so. After doing that, my youtube videos etc all couldnt work. So googled again and did whatever the rest suggested - download latest version of Java, uninstall java and reinstall again, install other versions of java etc etc. all didnt worked.
    Someone just pointed out that I had deleted a very critical security file (x protect meta.plist) and might have more problems that I thought on my hand.
    Im not very technical or IT saavy, so please kindly advise. Most of the problems surfaced after deleting that file. And right now, plug in for videos are still not working even though I have attempted various 'solutions' suggested in this forum (the not too technical ones) and java is still cranky. Pls advise. thanks!

    Anyone able to help?
    1) How did u solve the missing/out of date plugin?
    - Have tried installing numberous times the latest version - doesnt work
    - Tried uninstalling and then reinstalled earlier versions of java - doesnt work too
    read somewhere to delete the xprotect meta plist - realised much later that piece of advice was for snow leopard OS and thus, did not work too. A forummer told me today this file is a critical security file and i should not have deleted it. WHat can I do now?
    current situation:
    still cant play youtube videos and other videos.
    java on some sites still cant work

  • Lot of addons are not working even after uninstalling and reinstalling them. Using 3.6.12 version of firefox with windows

    I am using 3.6.12 version of firefox with windows OS. Recently, lot of addons not working and not showing in task bar like IE tab, RC Search, Answers, Better Privacy, AdBlock plus, etc. I have some 15-20 addons installed of which only 5-6 addons are working .Please help

    Update to 3.6.17 in the first instance by clicking '''Help '''| '''Check For Updates'''.
    The main reason for this is because there was a security breach at Comodo which is an SSL certificate provider recently whereby a number of fraudulent certificates were inadvertently issued. These allow a hacker to impersonate any site including online banking and the Firefox version you're running at the moment will not warn you that the site is a fake. The fraudulent certificates were blacklisted in v3.6.17 and beyond.
    See: http://blogs.comodo.com/category/it-security/data-security/
    It's not a good idea to install an ActiveX control in Firefox because you expose your machine to exploits which target that Microsoft technology. If you need to use Internet Explorer, then do that rather installing the IE Tab.
    You may find your other add-ons start working properly after you update Firefox, so do that first.

  • HT1491 My password in iTunes will not work, even after changing it. It keeps showing a window to add PW. I do and it pops up again.

    My PW in iTues will not work. Even after changing it. Window pops up and ask for PW. Over and over.

    I would be worried about that - but it may turn out to be nothing.
    Since you already changed your password, you're probably OK - but I recommend looking at your purchase history to see if there's any unauthorized purchases (use iTunes on your Mac or PC to go to the itunes store, then click your account in the upper-left or upper-right corner). If there are any new purchases that you didn't make, click the button to report problem (and if they happened after you reset your password, you should immediately change your password again).
    I think sometimes when you change your password and verifiy your credit card info, it can "reset" the warnings - so it may actually have been you logging in to your own account that caused you to get the warning. But I'm not absolutely sure of that, so it's best to check your purchase history (and reset your password if necessary - but you already did that).
    I also recommend turning on "two-step verification" (but Apple makes you wait a few days after changing your password to turn that on). With "two-step verification", Apple will send you a text message with a 4-digit code the 1st time you try to buy something from a new computer - since a hacker won't have your phone, they won't be able to continue (theoretically). After the 1st time, it goes back to mostly working normally (until the 1st time you  try to purchase from another new computer, then you get another text message - so this alerts you to someone, somewhere else, trying to get into your account).

Maybe you are looking for

  • Upgrade Sharepoint 2010 SQL Reporting Services from 2008 R2 to 2014

    I'm about to do the upgrade of SharePoint 2010 Reporting Services from 2008 R2 to 2014.  The instructions say it can be done "in-place" with no downtime.  I've seen this article: http://whitepages.unlimitedviz.com/2012/03/upgrading-sql-server-reporti

  • I cann't type label in foreign language in form.

    In form, I type foreign language in label in display option. When this form is run, it show something else that cann't read. What should I do? In my case, I type in Thai. Please tell me. Thank you.

  • Mac Pro 08 crashes live

    this is very odd.  I've had minor crashes and lockups in the past that do a full reboot.  For the last week the crashes been hapening at odd intervals, sometimes under a load (graphic designing), sometimes just listening to itunes.  What makes it odd

  • Toshiba 32RL938F - Where to report a bug?

    Hi, can someone tell me where to report a problem with TV firmware in order to be fixed? Is there an email address for this purpose?

  • Bleeds in Illustrator CS3 being saved as PDF

    I've created artwork for business card in Illustrator CS3.  It is going to a printer online.  When saving it as a PDF only the trim marks show, not the bleed, even though I've changed it under the Bleed section to 5mm (and all 4 boxes changed).