string input( string prompt )
input prompts the user to enter a single line of input and returns the entered string.
|
NOTE: If the user enters a string, use the atoi function to convert the string to an integer. |
menu_selection = input("Enter your selection: "); switch(atoi(menu_selection)) { … }
string inputnoecho( string prompt )
inputnoecho prompts the user for a single line of input. The input is not displayed on the screen as it is typed.
Instr = inputnoecho("Enter Selection: "); if (Instr in allowed_strs) { …. }
print ( expression exp1 [, expression exp2, ...] )
The print procedure prints the expression to stdout as a single line terminated with a newline character. If there is more than one argument, they are printed with a space delimiter. You can use variables, numbers, strings, lists or expressions as arguments in this function.
print("Hello world");
printf ( string format [, expression exp1, ...] );
The printf procedure prints a formatted string to stdout.
|
NOTE: For more information about formatting parameters, see the printf(3) man page. |
#this prints " 10" with no newline. printf("%4d", 10); #this prints "cory" preceded by 16 blank spaces, terminated with a newline. user="cory"; printf("%-20.20s\n", user);
© 2021 One Identity LLC. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy