Sponsored Content
Top Forums Shell Programming and Scripting Blog-Thread: Creating a Shell Wrapper and Runtime Modifier (SWARM) Post 303046100 by sea on Thursday 23rd of April 2020 07:00:02 PM
Old 04-23-2020
Get your daily dose of code here!

How to make a simple 'press enter to continue' - "complex"?
You add options Smilie
Code:
	press() { # [-c -l -r] [STR]
	# Requires the user to press [Enter/Return] before script continues
	# c=center ,l=left , r=right
		# Vars
		local mode=""
		# Catch arguments
		for opt in "${@}"
		do	if [[ "-" == "${opt:0:1}" ]] 
			then	case "${opt/-}" in
				"c")	mode="center"
					shift
					;;
				"l")	mode="left"
					shift
					;;
				"r")	mode="right"
					shift
					;;
				esac
			fi
		done
	# Display	
		case "$mode" in
		"center")
			printl "" "${1:-$SWARM_MSG_PRESS_ENTER}" "" 
			;;
		"left")
			printl "${1:-$SWARM_MSG_PRESS_ENTER}"
			;;
		"right")
			printl "" "" "${1:-$SWARM_MSG_PRESS_ENTER}" 
			;;
		*)
			printl "${1:-$SWARM_MSG_PRESS_ENTER}" "" "${1:-$SWARM_MSG_PRESS_ENTER}"
			;;
		esac
	# Action :p	
		builtin read
	}

Oh it will be so fun when/once I add/ed 'kiosk'-mode to several functions Smilie

Last edited by sea; 04-23-2020 at 08:15 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

korn shell version at runtime?

How can I check what kornshell version I am using at runtime from within a kornshell script? (3 Replies)
Discussion started by: qanda
3 Replies

2. Shell Programming and Scripting

crontab is not creating runtime files which are in script..

this is the output i am getting here.. cp: cannot create /wls_domains/eoigw/eoigwsA/deliv/cron/MailingScript/eoigwsA_Health_Status_Report.html: Permission denied /wls_domains/eoigw/eoigwsA/deliv/cron/MailingScript/ /wls_domains/eoigw/eoigwsA/deliv/cron/MailingScript/GenerateReport.sh:... (6 Replies)
Discussion started by: surekha268
6 Replies

3. Shell Programming and Scripting

Korn Shell Wrapper script

Hi Guys, I am trying write a wrapper script but I don't have any idea. I have 4 different korn shell scripts and all of them needs some parameters from command line (positional parameter). My script cant be interactive because its supposed to be automated. I am confused how can I write a wrapper... (6 Replies)
Discussion started by: pareshan
6 Replies

4. Web Development

Creating a blog site on a local computer

Hello! I would like to create a blog website on a web domain of mine. The blog will be used for publishing economics-lated articles. I tried to use a few open source packages for blog creation (WorldPress, b2evolution, Movable type) which I wanted to test on a local computer before arranging... (5 Replies)
Discussion started by: degoor
5 Replies

5. Programming

creating multiple threads using single thread id

Hi all, Can I create multiple threads using single thread_id like pthread_t thread_id; pthread_create(&thread_id, NULL, &print_xs, NULL); pthread_create(&thread_id, NULL, &print_ys, NULL); pthread_create(&thread_id, NULL, &print_zs, NULL); pthread_join(thread_id, NULL); what... (2 Replies)
Discussion started by: zing_foru
2 Replies

6. Shell Programming and Scripting

Shell Runtime Statistics

Hi, I am trying to capture runtime stats of a shell script (c shell). Are there system variables to call? Or should I create a date variable at the start of the script and at the end of the script? I am trying to capture the time if the script stops or ends with error. Please help. ... (4 Replies)
Discussion started by: CKT_newbie88
4 Replies

7. Shell Programming and Scripting

Wrapper Script in Perl Or shell

Hello, My requirement is based on Oracle where we run a perl script and it asked some questions.I want to write a wrapper which will answer all these questions. How is it possible. Thanks (16 Replies)
Discussion started by: cotton
16 Replies

8. Homework & Coursework Questions

Shell Script average runtime

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Make a bash script that calculates average runtime for the first two scripts you made. The average should be... (17 Replies)
Discussion started by: navlelo
17 Replies

9. Shell Programming and Scripting

Shell Script and Progress Bar or GUI Wrapper

Hi, I have shell script that I am running under Ubuntu as root. Is it possible to hide the command window and show the user some sort of progress /random progress bar / or other form of GUI interaction? On MAC, I have been using Platypus but on Ubuntu I am not sure what to do. (4 Replies)
Discussion started by: naveedanwar4u
4 Replies
moovida(1)						      General Commands Manual							moovida(1)

NAME
moovida - open source cross-platform media center SYNOPSIS
moovida [ OPTION]... [ CONFIG FILE] DESCRIPTION
Moovida is an open source cross-platform media center solution designed to be simple for people not particularly familiar with computers. With Moovida you can enjoy: * Watch your pictures with previews and nicely animated slideshows. * Watch your movies and video clips as well as online ones. * Manage your music collection by artists or albums covers. * Moovida finds automatically medias on your network, from network drives, Windows Mediaplayer, etc. * Detects automatically iPods, cameras, USB hard drives, etc. Moovida runs on the top of the GStreamer multimedia framework and uses the Pigment library for graphical user interaction. You can use it with your mouse, lirc-input device or simply with the keyboard. OPTIONS
--version Print the version of Moovida. --twisted-version Print the version of twisted. -t, --tracebacks Output tracebacks on the console output. Disabled by default. -l, --log Log the output to the given file. --shell Open an interactive shell of the Moovida environment in the terminal. --headless Start Moovida in headless mode. --force-startup Start even when another instance is running. -f, --fullscreen Start fullscreen (default). -u, --unfullscreen Do not start fullscreen. -n, --nosplash Do not show the splash schreen on startup. -i, --import=FILE Import the given Python file and run it in the Moovida environment (used by Windows only). -c, --config-file=FILE Use the specified configuration file instead of the default one. --rss=URL Start Moovida with a specific URL of an RSS feed. --help Show usage information and exit. KEYBOARD CONTROL
To navigate through the menus, Moovida reacts on key presses: Basic keys Left/Right/Up/Down Move left/right/up/down f or Escape Toggle fullscreen mode Enter Activate/open selected item Backspace Go back Menu hidden and player active Left or v Seek backward Right or b Seek forward Up/Down Volume up/down Enter Toggle play/pause x Previous track of playlist c Next track of playlist List menu mode Up/Down Navigate in the current menu level Right Go in the "More Options" menu if there's one. If there's no such menu you in fact go to the top context bar. Enter Call the default action on the selected item (ex: play the movie if you are in a movie list) Backspace Go to previous menu Grid menu mode The user can navigate in the 4 directions (up, down, left, right) using the direction keys (Left/Right/Up/Down). When the first row of the grid is reached, the user can enter the top context bar by hitting Up key once more. When the last row of the grid is reached, the user can enter the grid context bar by hitting Down key once more. Navigation inside the grid context bar is horizontal, use Left/Right keys to navigate in the 3 buttons. To activate a button, press Enter. To leave the context bar, press Up key. Top context bar When navigating inside menus, there should always be a context bar available on the top of the window. Navigation inside this bar is horizontal, use Left/Right keys to navigate in the bar buttons. To activate a button, press Enter. To leave the context bar, press Down key. FILES
~/.moovida/moovida.conf REPORTING BUGS
Report Moovida bugs on Launchpad: <http://bugs.launchpad.net/elisa/>. AUTHORS
Moovida was written by the Moovida team <contact@fluendo.com>. This manual page was previously written Philippe Normand, got reworked by Benjamin Kampmann and updated by Paul van Tilburg. DISTRIBUTION
The latest version of Moovida may be downloaded from <http://www.moovida.com/>. 2009-07-14 moovida(1)
All times are GMT -4. The time now is 12:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy