In a Case switch, how to ignore case sensitive in the test:
e.g.
case "$field" in
"TEST) action1;;
*) action2;;
esac
How to go in action1 in case of $field = TEST , or Test , or test or .... without enumerating all possibilities...
Thanks,... (1 Reply)
egrep -A 7 -m 2 -h 'Date:|Time:' *.html
this is showing only 2 line after the context of the 2nd found match. Is this a bug in grep?
egrep -A 7 -m 2 -h 'Time:' *.html - this works correctly (2 Replies)
Hi,
In below code, i am expecting the output has
Bye
Bye
But i am getting has
Bye
Hi
Code:
#!/usr/bin/bash
var="Hi"
cat txt.txt | while read var1
do
next="Bye"
case $var in
Hi) (1 Reply)
Hi Experts team,
i wish to use switch case in unix.
my req is
case $code in
1111)
echo "1111"
1112)
echo "1112"
*)
echo "default"
esac
see eventhough for particular case 1111 , it is always execute the default statement *), if i code like this.
How can handle... (2 Replies)
I started writing a script to save the files from a camera I got the other day, which mounts in /Volumes , and I got into it and started building this menu. The only problem is that the switch case is coming up as a syntax error at the parenthesis after a case. Here is the code:
while :
do
... (2 Replies)
Hi
Am pretty new to C..
Am trying to pass the arguments from command line and use them in switch case statement..
i have tried the following
#include <stdlib.h>
main(int argc, char* argv)
{
int num=0;
if ( argc == 2 )
num = argv;
printf("%d is the num value",num);
switch ( num )
... (2 Replies)
Hi there,
I'm trying to run a simple script,but i'm always getting this error
Syntax error: word unexpected (expecting "in")I have searched many sites,like this,but i dont get it,it looks good so far,but wont work,maybe someone can help me.
Here is the Script
#!/bin/bash
while :
do... (6 Replies)
Discussion started by: JustAnUser
6 Replies
LEARN ABOUT OPENDARWIN
pwd
PWD(1) BSD General Commands Manual PWD(1)NAME
pwd -- return working directory name
SYNOPSIS
pwd [-LP]
DESCRIPTION
The pwd utility writes the absolute pathname of the current working directory to the standard output.
Some shells may provide a builtin pwd command which is similar or identical to this utility. Consult the builtin(1) manual page.
The options are as follows:
-L Display the logical current working directory.
-P Display the physical current working directory (all symbolic links resolved).
If no options are specified, the -P option is assumed.
ENVIRONMENT
Environment variables used by pwd:
PWD Logical current working directory.
DIAGNOSTICS
The pwd utility exits 0 on success, and >0 if an error occurs.
STANDARDS
The pwd utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
SEE ALSO builtin(1), cd(1), csh(1), sh(1), getcwd(3)BUGS
In csh(1) the command dirs is always faster because it is built into that shell. However, it can give a different answer in the rare case
that the current directory or a containing directory was moved after the shell descended into it.
The -L option does not work unless the PWD environment variable is exported by the shell.
BSD February 4, 2002 BSD