Hi
I'm writing a script and I've put #!/bin/bash as the first line so that I can just type my scripts name 'whodate' at PS1 instead of ./whodate. This has suddenly stopped working for me. It used to be the case that I could start a script with #!/bin/bash and it would work, but for this script... (2 Replies)
i have this code for a simple if loop:
#!/bin/bash
array="1 2 3 4 5"
array2="5 6 7 8 9"
if } -gt ${array} ]; then
echo "${array2} is greater than ${array}!!"
fi
the error is
./script8: line 9: [: too many arguments
./script8: line 9: [: too many arguments
./script8: line 9: [:... (10 Replies)
So I need a script that does the following:
If a certain user is logged in
Run `command`
Else
Echo “incorrect user”
This is my first stab...which doesn't work:
#!/bin/bash
X="user=`ls -l /dev/console | cut -d " " -f 4`"
Y="foobar"
echo $X
echo $Y (4 Replies)
Hi Friends,
I am presently migrating shell scripts writter in KSH to SH.I am stuck at this place and i am not able to find a work around:-
Let the script name is x.sh
Below are some of the codes in it...
export abc=hello
export abc=hi
export abc=how
When i am trying to compile the script ... (6 Replies)
Hello all,
I'm trying to substract 1 minute from the current date and take the hour and minute (for filename purpose).
1) If I want hour an minute from current time I can use:
timetmp=$(date +"%H:%M")
2) To substract 1 minute from current time I can use:
timetmp=$(date --date "$dte -1... (8 Replies)
Hi friends,
I have two files - input and commands
I want to read the input and replace a value in it with the contents in commands.
My script is like this.
Instead of printing the value in the commands file, it is simply printing $cmd in the output file.
Any pointers are highly... (1 Reply)
Hi, I am currently working on a Bash shell script that
- Downloads a webpage, in this case youtube.com
- Extracts Number of views, Extracts Title of video, Extracts User who made it, and lastly Duration. Then I have to Out put this into columns.
To me this sounds like crazyness. I'm very new... (6 Replies)
How to run several bash commands put in bash command line without needing and requiring a script file.
Because I'm actually a windows guy and new here so for illustration is sort of :
$ bash "echo ${PATH} & echo have a nice day!"
will do output, for example:... (4 Replies)
Ahoy friends.
Currently i got a bash script running to manage my minecraft servers.
All of them are stored in /home/minecraft_servers directory.
Using my script im able to start a server (e.g. ./minecraft start ftb_continuum) because server name and server name are the same.(e.g.... (2 Replies)
Discussion started by: Knogle
2 Replies
LEARN ABOUT DEBIAN
macrocmd
MacroCmd(3U) InterViews Reference Manual MacroCmd(3U)NAME
MacroCmd - a command that composes other commands
SYNOPSIS
#include <Unidraw/Commands/macro.h>
DESCRIPTION
MacroCmd composes other commands in a linear fashion. Executing a MacroCmd is equivalent to executing its children in preorder.
PUBLIC OPERATIONS
MacroCmd(ControlInfo*)
MacroCmd(
Editor* = nil,
Command* first = nil, Command* second = nil,
Command* third = nil, Command* fourth = nil
)
Construct a MacroCmd instance, optionally supplying up to four of its child commands.
virtual void Execute()
virtual void Unexecute()
virtual boolean Reversible()
Execute simply executes each child, from first to last. Unexecute calls Unexecute on each child, from last to first. The MacroCmd
is reversible if any of its children are.
virtual void SetEditor(Editor*)
SetEditor calls SetEditor on each child with the given argument.
Command* GetCommand(Iterator)
void SetCommand(Command*, Iterator&)
GetCommand returns the child Command to which an iterator points. SetCommand initializes the iterator to point to a particular
child Command; it initializes the iterator to point to a nil instance if the given Command is not a child.
void Append(
Command*, Command* = nil, Command* = nil, Command* = nil
)
void Prepend(
Command*, Command* = nil, Command* = nil, Command* = nil
)
void InsertAfter(Iterator, Command*)
void InsertBefore(Iterator, Command*)
void Remove(Command*)
void Remove(Iterator&)
Operations that modify the MacroCmd's list of children. Append and Prepend add up to four Commands to the end and the beginning of
the list, respectively. InsertAfter and InsertBefore insert a Command after and before the Command pointed to by the iterator,
respectively. The Remove operations remove a child from the list without deleting it. You can remove a child by referring to it
explicitly or by specifying an iterator. If an iterator is supplied, the Remove operation should advance it to point to the follow-
ing child as a side effect.
PROTECTED OPERATIONS
Command* Cmd(UList*)
UList* Elem(Iterator)
Convenience functions for extracting a Command from a UList element a UList from an iterator, respectively.
SEE ALSO Command(3U), Iterator(3U), UList(3U)Unidraw 24 January 1991 MacroCmd(3U)