Skip to content

Instantly share code, notes, and snippets.

View skymansandy's full-sized avatar
🤓

P Sandesh Baliga skymansandy

🤓
View GitHub Profile
echo "Enter the name of first file: "
read file1
echo "Enter the name of second file: "
read file2
fp1=`ls -l $file1|cut -c 2-10`
fp2=`ls -l $file2|cut -c 2-10`
if [ $fp1 = $fp2 ]
then
echo "Files $file1 and $file2 have same permission $fp1"
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
void main()
{
char command[20];
int ch,pid=fork();
if(pid==0)
echo "Non Recursive shell Script"
echo "The total number of arguments specified:$#"
echo "The given $# arguments are :$*"
temp1=$#
echo "The arguments in reverse order:"
while [ $temp1 -ge 1 ]
do
eval echo \$$temp1
temp1=`expr $temp1 - 1`
done
%{
#include<stdio.h>
#include<stdlib.h>
%}
%token A B
%%
str: s '\n' { return 0;}
s : x B ;
x : A A A A A A A A A A T ;
T: T A
%{
/* 6.l Yacc program to recognize the grammar AnB where n ≥ 10 */
#include "y.tab.h"
%}
%%
a return A;
b return B;
. return yytext[0];
\n return yytext[0];
%%
%{
/* 6.l Yacc program to recognize the grammar AnB where n ≥ 10 */
#include "y.tab.h"
%}
%%
a return A;
b return B;
. return yytext[0];
\n return yytext[0];
%%
%{
/* 5b.l Program for the grammar AnBn where n≥0 */
#include "y.tab.h"
%}
%%
a {return A;}
b {return B;}
. {return yytext[0];}
\n {return yytext[0];}
%%
%{
#include<stdio.h>
#include<stdlib.h>
/* 5b.y Program for the grammar AnBn where n≥0 */
%}
%token A B
%%
str: s '\n' { return 0;}
s : A s B ;
| ;
%{
#include <stdio.h>
#include<stdlib.h>
%}
%token NUM
%left '+' '-'
%left '*' '/'
%%
expr : e { printf(" Result : %d\n",$1); return 0;};
e : e '+' e {$$=$1+$3;}
%{
#include<stdlib.h>
#include "y.tab.h"
extern int yylval;
%}
%%
[0-9]+ { yylval=atoi(yytext); return NUM; }
[\t] ;
\n return 0;
. return yytext[0];