You can find out if ls is a built-in in your shell using the command:
If ls isn't a built-in in bash, the bug is in ls; not bash. If bash was screwing up the expansion of abc*.txt, you'd see errors from ls like:
or:
instead of seeing funny names.
You might just be seeing the ls bug when it is called from bash due to differences in the size of the environment or the values of some environment variables that are being set by bash that are not set in ksh, or vice versa. And, with a different list of files, ls might work when called from bash and fail when called from ksh.
Sending the command you shared, the answer is different for type ls in bash and ksh. So, with the outputs below
does it mean that for ksh "ls" is a built-in command and for bash is not?
The output of type ls I previously posted are in the machine GNU/Linux where the
files are stored. I'd like to try to reproduce how is defined ls in GNU/Linux under cygwin terminal
to see if I get issues before to change something in GNU/Linux machine.
In cygwin the ls command is like this:
What I have to do in Cygwin in order that when I send type ls the output be the same as GNU/Linux machine,
I mean, get this
Thanks
Sending the command you shared, the answer is different for type ls in bash and ksh. So, with the outputs below
does it mean that for ksh "ls" is a built-in command and for bash is not?
Thanks again.
Regards
Expanding a bit on what Corona688 said...
No. It means that one of your bash startup files defines an alias for ls that adds the --color=tty option to ls every time you invoke it as ls. The commands:
will all probably work as you expect them to. Or you could issue the command: unalias ls and all uses of ls after that should behave as you would expect (in that shell execution environment).
According to the Linux ls man page, the valid values for the --color optional option argument are "always", "auto", and "never"; it doesn't say anything about what happens when it is set the way you have it ("tty"). According to that man page, the setting of the environment variable LS_COLORS (settable with the dircolors utility) could also be your problem. I don't have a CYGWIN ls man page, so "tty" may be valid there; try man ls to investigate further.
The ls utility on my system doesn't have this option, so I can't play around with it to make other suggestions.
[/ICODE]. The commands:
will all probably work as you expect them to.
Very nice Don,
The 3 options you mention make that ls output be correct this time!!!
Then the 3 different syntaxis for ls command you say is like say "use the built-in ls command"?
For reference, below is what "man ls" page of GNU/linux machine says about colors.
I think I'll use the ls command as you suggested since the outputs are correct in that way, without change anything
Many thanks for your great support to all
Addition: If I add --color to ls command makes that output be correct too.
Like this:
Then the 4 options below produce correct outputs:
Best regards
Last edited by Ophiuchus; 08-22-2014 at 02:31 PM..
Reason: Addition: If I add --color to ls command makes that output be correct too.
A Windows CMD prompt does not have ASCII colors, it does colors a different way. Cygwin may be trying to emulate ASCII colors and doing an imperfect job.
Hello.
Question 1 :
I want to comment out all lines of a cron file which are not already commented out for each full path pattern matched.
Example 1 nothing to do because line is already commented out; pattern = '/usr/bin/munin-cron'
# */5 * * * * munin test -x... (3 Replies)
Hi,
I need to do find and replace, but the pattern is not full known.
for example,
my file has /proj/app-d1/sun or /data/site-d1/conf
here app-d1 and site-d1 is not constant. It may be different in different files. common part is /proj/xx/sun and /data/xxx/conf
i want to find where ever... (6 Replies)
I want to pattern match only path part from below and replace them with new path string.
LoadModule jk_module /fldrA/fldrBaf/fldrCaa/modules/mod_jk.so
JkWorkersFile /fldrA/fldrBaf/fldrCaa/config/OHS/ohs1/workers.properties
JkLogFile... (4 Replies)
Hi all
I need your help to get a high-performance solution.
I am working on a extensive script to automate file restores using the bprestore tool on a Solaris 5.10 server (bash 3.00). I will only paste the needed parts of the script to avoid any confusion.
To use the script the user has to... (2 Replies)
Does anyone know of a way to zip the resulting file from a find command?
My approach below finds the file and zips the entire directory path, which is not what I need.
After scanning the web, it seems to be much easier to perform gzip, but unfortunately the approach must use zip.
find `$DIR`... (5 Replies)
Hi all,
Can anyone help me on this. I have several WP sites that are affected by sql injections. But the contents are different as follows
western union india belgaum
western union india bolegaon
western union india barhaj
western union india budhana
western union india belda
western... (6 Replies)
Gurus,
I have a big file that needs to be sorted out and I cant figure out what to do. The file name is as below:
Name: xxxx yyyy nnnn
Description: dfffgs sdgsgsf hsfhhs
afgghhjdgj
fjklllll gsfhfh
Updated: jafgadsgg gsg
Corrected: date today
The file consists of line like these.
... (13 Replies)
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Hi!
1. I have a parameter file containing path to log files. For this example both paths are the same, one is stated directly and the second using env variables.
/oracle/admin/orcl/bdump/:atlas:trc:N
${ORACLE_BASE}/admin/${ORACLE_SID}/bdump/:${ORACLE_SID}:trc:N
2. I try to parse the path... (1 Reply)