Sponsored Content
Top Forums Programming Creating a bash based restricted shell Post 302849751 by noamr on Tuesday 3rd of September 2013 07:26:26 AM
Old 09-03-2013
Question Creating a bash based shell with auto complete

Hello.

I need to write a command line interface that can be invoked either directly from the shell (command sub-command arguments), or as a shell that can process sub-commands.
i want to use bash auto completion for both scenarios.

example: lets say my CLI module is called 'mycli' and there are 3 sub commands: add, list, delete.

for the first type of usage, one would write from the prompt:
Code:
ubuntu@ubuntu:/$mycli add -name myname

for the second type of usage, one would do the following:
Code:
ubuntu@ubuntu:/$mycli
MYCLI>add -name myname
MYCLI>list

i know how to create a bash autocomplete for the first example. but don't know how to create a shell-like prompt that will use bash auto complete for sub command processing.

any suggestions?

Last edited by noamr; 09-03-2013 at 08:47 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating email based on an output

Hello folks. I need to create a script that looks at a certain output (list of full paths of files) and gets the owner's name (2nd position in the path, for example: /dirA/jsmith/blah1/more_blah/still_blah... etc) Gets the jsmith and greps the related file for jsmith and send that output to... (1 Reply)
Discussion started by: saswerks
1 Replies

2. Shell Programming and Scripting

shell: creating different arrays based on function argument

hi, I was wondering if there was a good way to create an array within a function, where the name is based on a passed argument? I tried this: _____________________________ func(){ #take in 1st arg as the arrayname arrayName=$1 let i=0 while read line do arrayName=${line} let i+=1... (5 Replies)
Discussion started by: nix21
5 Replies

3. UNIX for Advanced & Expert Users

Creating USERs with restricted Access

Hi There, i need to creat USERS in UNIX with restricted access to different directories. for example user1 should have access to dir1 and dir2 user2 should have access to dir2 and dir3 Please help me (4 Replies)
Discussion started by: ramanan25
4 Replies

4. Shell Programming and Scripting

Bash shell: Creating Preferences

In OS X I'm currently writing a bash script that requires writing to preference file. I may eventually want to share it with users on other Unix-like OSs and would like to accommodate for that possibility ahead of time. Most OS X applications save preferences in xml-format plist files. These... (4 Replies)
Discussion started by: airsmurf
4 Replies

5. Shell Programming and Scripting

help needed with creating challenging bash script with creating directories

Hi, Can someone help me with creating a bash shell script. I need to create a script that gets a positive number n as an argument. The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Discussion started by: I-1
7 Replies

6. Shell Programming and Scripting

Creating a command on a BASH shell

Hi all. Suppose I have the following function in an executable file named "HOLA": ------------------------ function hola { echo "Hola ${@}."; } ------------------------ In addition, suppose that I want to execute the file so I can input my name next to ./HOLA. I mean,... (4 Replies)
Discussion started by: hresquivelo
4 Replies

7. AIX

Restricted shell

Hello I have a user with a Restricted Shell on a Aix 5.3. My question is about if I can add one more path on the home directory. I mean the user have in his home directory. for example /test/my_application/logs but I need that this user can view another log that is on another path, if this... (1 Reply)
Discussion started by: lo-lp-kl
1 Replies

8. UNIX Desktop Questions & Answers

Restricted shell with execution permission on a file

Hi, I've created a user which shell is the restricted one (/usr/lib/rsh), but I've realized that the user cannot execute a script !!! The scope was to allow the ssh access to a user that could not access to any other directories but there that user should be able to run a script that retrieves ... (2 Replies)
Discussion started by: mary0
2 Replies

9. Shell Programming and Scripting

Creating bash script to process a data file based on the menu

Hey, im fairly new to unix and Im trying to make this unix project that would display a menu and do the following. MENU =========================== (p, P) Print users info (a, A) Add new user (s, S) Search user (d, D) Delete user (x,X) Exit Enter your choice: Trying to... (3 Replies)
Discussion started by: ultimaxtrd
3 Replies

10. Shell Programming and Scripting

Creating a text based game using shell script.

Hello guys I'm new to shell scripting and I need to make a game using shell script. I want to know if it is possible for me a total noob to shell scripting to make this game. The game concept is simple: First thing when you launch the script you get a menu in which you select if you want to... (3 Replies)
Discussion started by: Othmane
3 Replies
UBUNTU-BUILD(1) 					      General Commands Manual						   UBUNTU-BUILD(1)

NAME
ubuntu-build - command-line interface to Launchpad build operations SYNOPSIS
ubuntu-build <srcpackage> <release> <operation> DESCRIPTION
ubuntu-build provides a command line interface to the Launchpad build operations. OPERATIONS
Listed below are the available operations for ubuntu-build: status Outputs the build status of the package on Launchpad on all architectures. retry Requests that the package has another attempt at rebuilding from source. This will only work if the package has Failed to build on Launchpad. rescore Requests that the package's build priority be raised in the build queue. Only members of the Launchpad build administrators may issue this operation, and it may only be performed on packages which Need building. OPTIONS
Listed below are the command line options for ubuntu-build: -h or --help Display a help message and exit. Retry and rescore options: These options may only be used with the 'retry' and 'rescore' operations. -a ARCHITECTURE, --arch=ARCHITECTURE Rebuild or rescore a specific architecture. Valid architectures include: amd64, sparc, powerpc, i386, armel, armhf, ia64, lpia, hppa. Batch processing: These options and parameter ordering is only available in --batch mode. Usage: ubuntu-build --batch [options] <package>... --batch Enable batch mode --series=SERIES Selects the Ubuntu series to operate on (default: current development series) --retry Retry builds (give-back). --rescore=PRIORITY Rescore builds to <priority>. --arch2=ARCHITECTURE Affect only 'architecture' (can be used several times). Valid architectures are: amd64, sparc, powerpc, i386, armel, armhf, ia64, lpia, hppa. AUTHORS
ubuntu-build was written by Martin Pitt <martin.pitt@canonical.com>, and this manual page was written by Jonathan Patrick Davies <jpds@ubuntu.com>. Both are released under the terms of the GNU General Public License, version 3 or (at your option) any later version. ubuntu-dev-tools June 2010 UBUNTU-BUILD(1)
All times are GMT -4. The time now is 02:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy