The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
su (switching to other user) bjagadeesh Shell Programming and Scripting 2 05-21-2008 04:51 AM
switching to another user in shell script... bjagadeesh Shell Programming and Scripting 1 02-28-2008 07:10 AM
switching user from root to ordinary user sasia Shell Programming and Scripting 3 01-25-2008 10:25 PM
FTP - switching user syntax daveaasmith UNIX for Dummies Questions & Answers 1 09-05-2007 08:03 AM
Switching to single-user mode gmoyano UNIX for Dummies Questions & Answers 1 08-05-2002 09:50 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-20-2008
bjagadeesh bjagadeesh is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 9
su (switching to other user)

Hi,

what is the use of the double quotes and !! in the following code segment:

su - user1 << ""!! > /dev/null 2>&1
echo "welcome user1"
EOF
!!

also what is the difference between below:

su - user1 << ""!! > /dev/null 2>&1 and
su - $USER << ""!!!> /dev/null 2>&1.

Note: $USER = user2


Jagadeesh.
  #2 (permalink)  
Old 05-20-2008
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,726
The !! marks the boundaries of a here document. Why the EOF is there I have no idea.
the "" (empty string ) forces the shell to "see" the !! probably because of an older shell.
It will work in a modern shell, like ksh, without the "". Either way works. The "" seems just to add confusion for me.

You can use !!! or any other nonsense (nonsense to the shell) combination of letters to set up a here doc. The only requirement is that they be indentical. like EEE and EEE
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0