473,378 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

when will cd * work?

123 100+
Hi,

Kindly let me what would be the output of cd * command in UNIX?
Jul 19 '07 #1
3 3160
mac11
256 100+
Hi,

Kindly let me what would be the output of cd * command in UNIX?
When I do this it cd's me into the first directory (alphabetical order) so if I'm in a directory with sub-directories A/ and B/ cd * takes me into A/
Jul 19 '07 #2
archonmagnus
113 100+
When I do this it cd's me into the first directory (alphabetical order) so if I'm in a directory with sub-directories A/ and B/ cd * takes me into A/
That is if the alpha-numeric "first-hit" is a directory. If the "first-hit" is a file, it will echo (in my case at least):
Expand|Select|Wrap|Line Numbers
  1. bash: cd: 4x.ods: Not a directory
  2.  
Jul 19 '07 #3
michaelb
534 Expert 512MB
The examples above imply that noglob is not set (it's off) in the current shell. This built-in variable controls the wild card expansion and along with others can be set in a shell startup file - .login, .bashrc, .profile, .cshrc, etc.

In most cases it's unset, but just for the sake of argument consider this.
(The following uses the C-shell syntax, but concept may be valid for other shells too.)

Expand|Select|Wrap|Line Numbers
  1. % ls * 
  2.    // - produces a long list of files
  3. % set noglob
  4. %ls *
  5. ls: *: No such file or directory
  6. %cd *
  7. *: No such file or directory.
  8.  // because shell was looking for file or dir literally named "*"
  9.  
Jul 20 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Brian McGee | last post by:
I have a database with over 450 tables, that until a short while ago has been strictly 3NF. In cases where complicated permutations of data are required quickly for certain parts of the system,...
8
by: dixie | last post by:
I want to run an event when I press the Ctl key simultaneously with the K key. How do I achieve this in VBA? dixie
6
by: Terry Bell | last post by:
We've had a very large A97 app running fine for the last seven years. I've just converted to SQL Server backend, which is being tested, but meanwhile the JET based version, running under terminal...
7
by: theyas | last post by:
How can I get my code to NOT display two "Open/Save/Cancel/More Info" dialog boxes when using the "Response.WriteFile" method to download a file to IE I've asked about this before and didn't get a...
24
by: Desmond Cassidy | last post by:
Hi, I don't know whether this is the correct place to ask this question..anyway here goes... I have a large solution with about 300 .vb files split into 9 projects VB.net Framework 1.1 WinXP...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
52
by: lovecreatesbeauty | last post by:
Why the C standard committee doesn't provide a standard implementation including the C compiler and library when the language standard document is published? C works on the abstract model of low...
3
by: Jay-nospam | last post by:
Hi there, I am having trouble getting an ASP.NET web application to connect to another computer and passing the proper credentials and I hope someone can help me. I have a stand-alone Windows...
11
by: bill | last post by:
I dynamically create buttons and associate them with an event using AddHandler. I want all the button events to fire at one time, when the page is posted, instead of when each button is clicked....
4
by: grayaii | last post by:
Hi, I have a simple form that handles all its paint functionality like so: this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); And the entry point to this...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.