Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 28 Jul 2014, 17:11
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Need the shebang for all 1 line scripts
Moderators: Lobster, MU, raffy
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
y@s

Joined: 04 Apr 2009
Posts: 4
Location: Japan.

PostPosted: Sun 31 May 2009, 09:32    Post subject:  Need the shebang for all 1 line scripts  

Hi, all.
I'm Japanese. When my English is strange, tell me.

I expect that shebang(#!/bin/sh or #!/bin/bash) is added to all 1 line scripts.
When there is no shebang, bash misjudge that file as binary file if the 1st line includes some multi byte characters.
sample is below.


As one example, in case of the /usr/sbin/wag-profiles, this way is good.
Code:
*** /usr/sbin/wag-profiles.sh.org   2009-04-04 14:36:44.000000000 +0900
--- /usr/sbin/wag-profiles.sh   2009-05-31 21:07:51.000000000 +0900
***************
*** 1837,1843 ****
              SCANWINDOW_BUTTONS="$SCANWINDOW_BUTTONS \"$CELL\" \"$CELL_ESSID (${CELL_MODE}; ${L_SCANWINDOW_Encryption}$CELL_ENC_TYPE)\" off \"${L_SCANWINDOW_Channel}${CELL_CHANNEL}; ${L_SCANWINDOW_Frequency}${CELL_FREQ}; ${L_SCANWINDOW_AP_MAC}${CELL_AP_MAC};
  ${L_SCANWINDOW_Strength}${CELL_QUALITY}\""
           done
!          echo "Xdialog --left --item-help --stdout --title \"$L_TITLE_Puppy_Network_Wizard\" --radiolist \"$L_TEXT_Scanwindow\"  20 60 4  \
     ${SCANWINDOW_BUTTONS} 2> /dev/null" > /tmp/net-setup_scanwindow
        fi
        echo "X"
--- 1837,1843 ----
              SCANWINDOW_BUTTONS="$SCANWINDOW_BUTTONS \"$CELL\" \"$CELL_ESSID (${CELL_MODE}; ${L_SCANWINDOW_Encryption}$CELL_ENC_TYPE)\" off \"${L_SCANWINDOW_Channel}${CELL_CHANNEL}; ${L_SCANWINDOW_Frequency}${CELL_FREQ}; ${L_SCANWINDOW_AP_MAC}${CELL_AP_MAC};
  ${L_SCANWINDOW_Strength}${CELL_QUALITY}\""
           done
!          echo -e "#!/bin/bash\nXdialog --left --item-help --stdout --title \"$L_TITLE_Puppy_Network_Wizard\" --radiolist \"$L_TEXT_Scanwindow\"  20 60 4  \
     ${SCANWINDOW_BUTTONS} 2> /dev/null" > /tmp/net-setup_scanwindow
        fi
        echo "X"
***************
*** 2019,2025 ****
       echo "X"
     fi
     if [ "$SCANWINDOW_BUTTONS" ] ; then
!       echo "Xdialog --left --item-help --stdout --title \"$L_TITLE_Puppy_Network_Wizard\" --radiolist \"$L_TEXT_Prism_Scan\"  20 60 4  \
     ${SCANWINDOW_BUTTONS} 2> /dev/null" > /tmp/net-setup_scanwindow
     else
       #echo "Xdialog --left --title \"Puppy Network Wizard:\" --msgbox \"No networks detected\" 0 0 " > /tmp/net-setup_scanwindow
--- 2019,2025 ----
       echo "X"
     fi
     if [ "$SCANWINDOW_BUTTONS" ] ; then
!       echo -e "#!/bin/bash\nXdialog --left --item-help --stdout --title \"$L_TITLE_Puppy_Network_Wizard\" --radiolist \"$L_TEXT_Prism_Scan\"  20 60 4  \
     ${SCANWINDOW_BUTTONS} 2> /dev/null" > /tmp/net-setup_scanwindow
     else
       #echo "Xdialog --left --title \"Puppy Network Wizard:\" --msgbox \"No networks detected\" 0 0 " > /tmp/net-setup_scanwindow

Regards.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0518s ][ Queries: 12 (0.0107s) ][ GZIP on ]