Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

How to make a command like PICO in linux but with comments?


  • Please log in to reply
9 replies to this topic

#1 jrdncchr

jrdncchr

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:12:38 AM

Posted 06 March 2011 - 12:09 AM

i need to make a linux command but i dont know how..
my proposal is to make a command same as pico but with comments..
for example if i enter picoc, it will rune like pico but with this comments..
#==================================
#Script Name:
#By:
#Date:
#Purpose:
#:Command Line:
#====================================

help me thanks

BC AdBot (Login to Remove)

 


#2 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,260 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:09:38 PM

Posted 06 March 2011 - 06:00 AM

I'm not sure what you're asking here. Pico is a text-mode text editor. Are you asking how to write programs for Linux?

#3 jrdncchr

jrdncchr
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:12:38 AM

Posted 06 March 2011 - 07:42 AM

hmm. no i need command or a shell script.
that when i enter picoc it will run in pico but with a customized comments already.

#==================================
#Script Name:
#By:
#Date:
#Purpose:
#:Command Line:
#====================================

#4 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,260 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:09:38 PM

Posted 06 March 2011 - 07:35 PM

#!/bin/bash
args=("$@")
echo "#=================================="
echo "#Script Name: Pico Script With Comments"
echo "#By: Me"
echo "#Date: 3/6/2011"
echo "#Purpose: Pico, with comments"
echo "#:Command Line: picoc"
echo "#==================================== "
pico $@


Like that?

#5 jrdncchr

jrdncchr
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:12:38 AM

Posted 07 March 2011 - 10:02 AM

#!/bin/bash
args=("$@")
echo "#=================================="
echo "#Script Name: Pico Script With Comments"
echo "#By: Me"
echo "#Date: 3/6/2011"
echo "#Purpose: Pico, with comments"
echo "#:Command Line: picoc"
echo "#==================================== "
pico $@


Like that?

Ohh thanks I think this is helping me.. but an error occur~
it says

picoc: 2: Syntax error: "(" unexpected

pls help..this is due on wed :o

#6 jrdncchr

jrdncchr
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:12:38 AM

Posted 07 March 2011 - 10:12 AM

args=("@$") is the prob..
do i need to install any? don't know hmmmm

Edited by jrdncchr, 07 March 2011 - 10:55 AM.


#7 jrdncchr

jrdncchr
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:12:38 AM

Posted 07 March 2011 - 10:33 AM

also if u can use the command cat in making this proposal? but if it is not needed nvm.. pls rep thx

#8 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,260 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:09:38 PM

Posted 07 March 2011 - 12:50 PM

This works in Bash for me. I don't know why it's not working for you.

#9 jrdncchr

jrdncchr
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:12:38 AM

Posted 08 March 2011 - 04:57 AM

This works in Bash for me. I don't know why it's not working for you.

i see can u give me another style in making the propsal? using cat or any that is basic. and u can use 2 shell script. but the picoc must be a new buffer.

#10 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,260 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:09:38 PM

Posted 08 March 2011 - 12:44 PM

If picoc must be a new buffer then you can remove the references to $@:

#!/bin/bash
echo "#=================================="
echo "#Script Name: Pico Script With Comments"
echo "#By: Me"
echo "#Date: 3/6/2011"
echo "#Purpose: Pico, with comments"
echo "#:Command Line: picoc"
echo "#==================================== "
pico





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users