If you read the entire file into an array
you can print the array like that - without a loop.
Or even directly from the file
But there is a small problem to detect the "not found" condition.
These 2 Users Gave Thanks to MadeInGermany For This Post:
I would like to add the ability to change the message that is displayed when timer is finished. At present it just asks for the time I want for the alarm.
I think what I need is another command line argument.
soundfile="/usr/share/sounds/My_Sounds/Alarm-sound-buzzer.mp3"... (5 Replies)
Hi Guys, I'm trying to work out how to add a command line argument inside single quotes. Would anyone be able to help please as I'm going mad :)
I want to be able to place the filename on command line and it then be used in a script but it needs to have quotes surrounding it.
Thanks in... (4 Replies)
I'm trying to write a bash script called YN that looks like the following
YN "Specify a question" "doThis" "doThat"
where "doThis" will be executed if the answer is "y", otherwise "doThat".
For example
YN "Do you want to list the file dog?" "ls -al dog" ""
Here's my attempt... (3 Replies)
I would like to use a string as a command line argument...is this possible using TCSH? For example say my script is called TEST and I would like to pass a string into my script stating why the test failed.
EXAMPLE:
TEST "Failed due to missing statement" (4 Replies)
how do i check if a command line argument is -g?
for example,
if command line argument equals "-g"
{
print "Goodbye \n";
}
else
{
print "Welcome to the program! \n";
} (1 Reply)
Hi Guys
When I run the below command
ssh -o 'PasswordAuthentication yes' -o 'PreferredAuthentications publickey' -i $HOME/.ssh/id_dsa Server_Name
I found the below error
ommand-line line 0: Missing yes/no argument
Kindly help me to sort out
Double post, continued... (0 Replies)
Hi,
I have a very simple C program which will run in UNIX. When i am passing * as the command line argument, i am gettig the below output.
Program:
#include <stdio.h>
#include "mylibrary.h"
int **environ;
int main(int argc,char *argv)
{
int i;
printf("\nHello... (2 Replies)
Hi ,
I have a piece of code ...wherein I need to assign the following ...
1) A command line argument to a variable
e.g origCount=ARGV
2) A unix command to a variable
e.g result=`wc -l testFile.txt`
in my awk shell script
When I do this :
print "origCount" origCount --> I get the... (0 Replies)
Say I want to get the value of last command line argument using the value in $# (or some other way if u can suggest) how do I do it??
$"$#"
`$"$#"`
These don't work :( (4 Replies)
I have a shell script which does the encryption of a file where i am passing the file name as a command line argument,but later on the script waits on the screen to enter Y or N
what is the command i should be using on the shell script
#!/bin/bash -x
outfilename=file.out
echo... (8 Replies)