473,787 Members | 2,928 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how easily can glob.glob say Unix bash `echo *`

http://wiki.python.org/moin/glob now mentions:

The glob module lists names in folders that match Unix shell patterns.

If the elemental function emulating Unix bash `echo *` really is
missing from the 2.5 Python batteries included, then here's a brief
clear way of adding that function to Python.

Mind you, to date I've never written an elemental function for Python
that I haven't eventually found well-buried somewhere, e.g.,
os.urandom.

P.S. glob.glob bash and glob.glob rm have no hits yet, said Google
Groups.

Nov 3 '07 #1
0 1140

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
3085
by: Georgy Pruss | last post by:
On Windows XP glob.glob doesn't work properly for files without extensions. E.g. C:\Temp contains 4 files: 2 with extensions, 2 without. C:\Temp>dir /b * aaaaa.aaa bbbbb.bbb ccccc ddddd C:\Temp>dir /b *.
6
3385
by: William Park | last post by:
(crossposted to comp.lang.python, because this may be of interest to them.) Python has try-block, within which you can raise exception. Once it's raised, execution breaks out of the try-block and is caught at the end of try-block. Now, Bash has similiar feature. I've added try-block and 'raise' builtin into Bash-3.0. Typical usage would go something like try
11
2999
by: Magnus Jonneryd | last post by:
Hi, I'm planning on writing a program that interactively is fed input via a shell (bash). I also want to be able to write a shell script that executes various commands related to my program. In short i want to provide input to a program using some (or all) of the functionality found in bash. It's mainly the format of the file I'm having trouble with. I wanted to be able to write something like this: #!/bin/bash for x in xs
16
3950
by: John Salerno | last post by:
Hi all. I just installed Ubuntu and I'm learning how to use the bash shell. Aside from the normal commands you can use, I was wondering if it's possible to use Python from the terminal instead of the normal bash commands (e.g. print instead of echo). My main reason for asking is that I like using Python for everything, and if I don't need to learn the bash 'language', then I won't just yet. Thanks.
3
2916
keyvanrahmadi
by: keyvanrahmadi | last post by:
hiya guys, i am trying to learn unix and i am sort of stuck in couple of questions, which i was hoping to get some help on. 1- i have created a file using the follwoing script: #!/bin/bash ls -l > cust1 ls -x >> cust1
14
4913
keyvanrahmadi
by: keyvanrahmadi | last post by:
Sorry if this post is rather long but hopefully you wont get bored half way through. I have a project in hand which i have started and have a deadline of 1 week. Basically what i need to do is to create a shell script in Bash for the game Hangman. I am sure everyone is well aware of the game. The down side is that i can not use "sed" or "awk". FUN FUN I am at my ends wit now and truley utterly lost, so any help would go a long way to stop...
17
1662
keyvanrahmadi
by: keyvanrahmadi | last post by:
Hello there guys, i think i am at the end of this, which i have to edmit has been a huge learning curve for me, but i still have couple of problems, which i was hoping you can help me. I think tbh its a very simple thing which i am over looking and just require a pair of fresh eyes to look at. I greatly appriciate if you could have a look at the script and let me know what you think. if you have any solution, or advise just email me or pm...
8
2375
by: mark.bergman | last post by:
I am porting from Digital Unix to Linux (RHEL 4), and am seeing a difference in the return value of glob(). Given a non-existant directory "/tmp/a", and the following line of code: result = glob("/tmp/a", GLOB_ERR, NULL, &globInfo); - result is set to GLOB_NOMATCH on both platforms. However, if the first parameter is changed to "/tmp/a/*", i.e. searching for files within the directory, the return value on Digital Unix is still...
4
2098
by: widevision7 | last post by:
I have a script where I am using glob to get a list of folders that end in "*import", but I am trying to change my directory to the previous one. Here is what I have: @directories = glob("*import"); @directories = sort { $b <=> $a } @files; I can't figure out how to make glob go back one directory. I am looking for something similiar to the Unix "cd .." command. I have tried glob("../*import") and dozens of variations, but nothing...
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.