- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Special char
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 10:04 PM
08-09-2010 10:04 PM
# ls
f1 f2 f3 f4 f5 r4 t1 t2 t3 t4 t5 t6 test1 test3
# ll t*
t* not found
# ll t?
t? not found
# ls t* <<<< wildcard not working
t* not found
It is NOT treating "*" as a wildcard but as a normal character.
Entry for root in passwd file:
root:EvTwA3Xd/eKd2:0:3::/:/sbin/sh
But when i reload the shell
# /sbin/sh
# ll t* <<<< work fine
How can I correct this problem?
Thanks..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 10:14 PM
08-09-2010 10:14 PM
Re: Special char
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 10:19 PM
08-09-2010 10:19 PM
Re: Special char
To see the files with special charcter you can open in vi in set list mode and you can find the files those got special character, that doesn't show up in normal ls -l.
1.# ls -l > list.txt
2.# vi list.txt
: set list
3. Delete & modification of filenames you can do with find command with inum option.
To see inode numbers to corresponding files you can use # ls -lai
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 10:22 PM
08-09-2010 10:22 PM
Re: Special char
> But when i reload the shell
# /sbin/sh
# ll t* <<<< work fine
- Seems to be problem with your shell.
- After login check the shell, # echo $SHELL
hth,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 11:02 PM
08-09-2010 11:02 PM
Re: Special char
# echo $SHELL
/sbin/sh
# ll t*
t* not found
but, when I do:
# /sbin/sh <<<< reload the same shell
# ll t*
-rw-rw-rw- 1 root sys 0 Aug 8 15:27 t1
-rw-rw-rw- 1 root sys 0 Aug 8 15:27 t2
-rw-rw-rw- 1 root sys 0 Aug 8 15:27 t3
-rw-rw-rw- 1 root sys 0 Aug 8 15:27 t4
-rw-rw-rw- 1 root sys 0 Aug 8 15:27 t5
-rw-rw-rw- 1 root sys 0 Aug 8 15:27 t6
-- --
-- --
# echo $SHELL
/sbin/sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2010 01:12 AM
08-10-2010 01:12 AM
Solution"set -f" disables "file name generation", also known as "pathname expansion" - and that includes wildcard character processing.
The /etc/profile and ~/.profile are executed only when the shell is invoked as a _login_ shell: reloading the shell within the same session does not re-run those login scripts.
All the exported environment variables and ulimit settings are automatically inherited by the new "child" process from its parent, so running the login scripts is not necessary to have them at correct settings in the "child" shell. But all the non-inheritable shell settings (aliases, shell functions, "set" settings etc.) will be lost. This explains why the wildcard processing works normally in the reloaded shell.
There is a special environment variable $ENV that can be used to make non-login ("child") shells execute a script at start-up. But it is not set by default, and surprisingly many sysadmins don't know about it.
MK
- Tags:
- noglob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2010 03:20 AM
08-10-2010 03:20 AM
Re: Special char
Ah. You can check by:
set -o
You should either see -f or noglob.
>$ENV ... surprisingly many sysadmins don't know about it.
Hmm, that was one of the first things I learned in Real Shell Programming 101. :-)
First that you copy it from someone else, then exactly what that arcane command did.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2010 06:29 AM
08-10-2010 06:29 AM
Re: Special char
Checked /etc/profile and found an entry of "set -f" in the end.
Also "set -o" confirmed the noglob was 'on'.
That was a fantastic catch..thanks again.