LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-08-2009, 06:09 AM   #1
bkcreddy17
Member
 
Registered: Feb 2008
Location: India-Hyderabad
Distribution: RHEL and Fedora
Posts: 171

Rep: Reputation: 15
Unhappy how to encrypt shell script


hi, i am trying to encrypt shell script. But i am getting this error. what to do?
Code:
$cat test1.sh
echo "hello"
cal
Code:
$ shc -f test1.sh
shc: invalid first line in script: echo "hello"
shc: Success
 
Old 04-08-2009, 06:26 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You have to put the sha-bang (e.g. #!/bin/bash) at the beginning of the script, since shc need to know which shell is using. Here is an excerpt from the manual page:
Code:
The  compiled  binary  will  still be dependent on the shell specified in the first line of the shell
code (i.e. #!/bin/sh), thus shc does not create completely independent binaries.
 
Old 04-08-2009, 06:51 AM   #3
bkcreddy17
Member
 
Registered: Feb 2008
Location: India-Hyderabad
Distribution: RHEL and Fedora
Posts: 171

Original Poster
Rep: Reputation: 15
thank you. got it
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
encrypt and decrypt using encrypt(char block[64], int edflag) rockwell_001 Linux - Security 3 08-30-2009 09:16 AM
Howto Encrypt & Run Bash script File nabeeliumattack Linux - General 7 05-17-2008 04:58 PM
encrypt shell script Swakoo Linux - Security 29 02-08-2007 07:16 PM
Compile/Encrypt Bash Script DoubleOTeC Programming 6 10-09-2005 07:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration