Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what does this do? ~

Status
Not open for further replies.

sammybee

Programmer
Sep 24, 2003
103
GB
Hi All,

Just converting a script someone else has written, am confused by the use of this ~ symbol?? What does it do??

Cheers

Sam

 
Sammy, my man,

Context, Context, Context... Can you please copy and paste the "surroundings" of its use? There is no specific syntactical meaning of "~" in Oracle, so it must be something programmatical.

Looking forward to seeing your code,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 17:37 (20Jan05) UTC (aka "GMT" and "Zulu"),
@ 10:37 (20Jan05) Mountain Time

Click here to Donate to Tsunami Relief. 100% of your contributions here go to the victims...0% to administration.
They were "The First-Responder" to the disaster, with relief deliveries arriving before Red Cross and U.S. aid.
 
In UNIX ksh it is a short form for 'the home directory of'

so ~user5 is the home directory of user5

Alex
 
And since it doesn't turn up very often in the data we maintain, I often use it as a default value for the NVL function (e.g., WHERE NVL(i.item_number, '~') = NVL(j.item_number,'~')).
So back to SantaMufasa's point - CONTEXT!
Otherwise, the answer must be "It depends".
 
Continuing with alex hu's almost correct remarks. In unix, it is an symbol/abbreviation for the user's home directory and can be used in statements such as cd ~ or referenced in path statements /~/work

-------------------------
The trouble with doing something right the first time is that noboby appreciates how difficult it was.
- Steven Wright
 
In your example of user5, the home directory of user5 is most likely /home/user5.

In this case, executing the command: cd ~
will be the equivalent of: cd /home/user5

Or to copy a file from your current directory to your home directory: cp filename ~
which is the equivalent of cp filename /home/user5

If this is what you meant, I apologize, but it was not clear to me.

-------------------------
The trouble with doing something right the first time is that noboby appreciates how difficult it was.
- Steven Wright
 
I think what Alex meant is that you can issue cd ~user5 as any other user and still end up in user5's home directory. He'll correct me if I'm wrong, no doubt.
 
Actually, the confusing part of this thread is that Sammy has left us in the dark about context for nearly a week. Sammy, please post sample code that indicates use of "~" so we can discuss your issue without guessing the use/purpose of "~".

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 19:05 (25Jan05) UTC (aka "GMT" and "Zulu"),
@ 12:05 (25Jan05) Mountain Time

Click here to Donate to Tsunami Relief. 100% of your contributions here go to the victims...0% to administration.
They were "The First-Responder" to the disaster, with relief deliveries arriving before Red Cross and U.S. aid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top