code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/bin/sh
# PRE-REVPROP-CHANGE HOOK
#
# The pre-revprop-change hook is invoked before a revision property
# is added, modified or deleted. Subversion runs this hook by invoking
# a program (script, executable, binary, etc.) named 'pre-revprop-change'
# (for which this file is a template), with the following or... | Shell |
#!/bin/sh
# PRE-LOCK HOOK
#
# The pre-lock hook is invoked before an exclusive lock is
# created. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-lock' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH (the pat... | Shell |
#!/bin/sh
# POST-REVPROP-CHANGE HOOK
#
# The post-revprop-change hook is invoked after a revision property
# has been added, modified or deleted. Subversion runs this hook by
# invoking a program (script, executable, binary, etc.) named
# 'post-revprop-change' (for which this file is a template), with the
# f... | Shell |
#!/bin/sh
# POST-LOCK HOOK
#
# The post-lock hook is run after a path is locked. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-lock' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repos... | Shell |
#!/bin/sh
# PRE-UNLOCK HOOK
#
# The pre-unlock hook is invoked before an exclusive lock is
# destroyed. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-unlock' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH ... | Shell |
#!/bin/sh
# START-COMMIT HOOK
#
# The start-commit hook is invoked before a Subversion txn is created
# in the process of doing a commit. Subversion runs this hook
# by invoking a program (script, executable, binary, etc.) named
# 'start-commit' (for which this file is a template)
# with the following ordered... | Shell |
#!/bin/sh
# POST-COMMIT HOOK
#
# The post-commit hook is invoked after a commit. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-commit' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this rep... | Shell |
#!/bin/sh
# POST-UNLOCK HOOK
#
# The post-unlock hook runs after a path is unlocked. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-unlock' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this... | Shell |
#!/bin/sh
# POST-UNLOCK HOOK
#
# The post-unlock hook runs after a path is unlocked. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-unlock' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this... | Shell |
#!/bin/sh
# PRE-REVPROP-CHANGE HOOK
#
# The pre-revprop-change hook is invoked before a revision property
# is added, modified or deleted. Subversion runs this hook by invoking
# a program (script, executable, binary, etc.) named 'pre-revprop-change'
# (for which this file is a template), with the following or... | Shell |
#!/bin/sh
# POST-LOCK HOOK
#
# The post-lock hook is run after a path is locked. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-lock' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repos... | Shell |
#!/bin/sh
# POST-REVPROP-CHANGE HOOK
#
# The post-revprop-change hook is invoked after a revision property
# has been added, modified or deleted. Subversion runs this hook by
# invoking a program (script, executable, binary, etc.) named
# 'post-revprop-change' (for which this file is a template), with the
# f... | Shell |
#!/bin/sh
# PRE-UNLOCK HOOK
#
# The pre-unlock hook is invoked before an exclusive lock is
# destroyed. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-unlock' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH ... | Shell |
#!/bin/bash
#
# This script checks the java version and bails if it's less
# than Java6 (because we use @Override annotations on interface
# overriding methods. It then proceeds to do a maven build that
# first cleans, then builds the normal lifecycle through compilation
# unit testing (if available) up to packaging. ... | Shell |
#-----------------
# make_release.sh
# Version: $Id: make_release.sh,v 1.1 2008/07/07 13:57:13 minahito Exp $
#-----------------
# This shell script removes unneeded directories and files from file tree that you checked out,
# and makes the file tree to release.
#
if [ -e ../html/xoops.css ]; then
find .. -t... | Shell |
#!/bin/sh
if [[ -z $ADB ]]; then ADB=adb; fi
./kill_process.sh
$ADB shell rm -r /data/data/com.google.android.apps.iosched/* | Shell |
#!/bin/sh
if [[ -z $ADB ]]; then ADB=adb; fi
$ADB shell am force-stop com.google.android.apps.iosched
| Shell |
#!/bin/sh
if [[ -z $ADB ]]; then ADB=adb; fi
$ADB shell "echo '$*' | sqlite3 -header -column /data/data/com.google.android.apps.iosched/databases/schedule.db" | Shell |
#!/bin/sh
# Sessions list
#adb shell am start -a android.intent.action.VIEW -d content://com.google.android.apps.iosched/tracks/android/sessions
# Vendors list
#adb shell am start -a android.intent.action.VIEW -d content://com.google.android.apps.iosched/tracks/android/vendors
# Session detail
#adb shell am start -a... | Shell |
#!/bin/sh
if [[ -z $ADB ]]; then ADB=adb; fi
MAC_UNAME="Darwin"
if [[ "`uname`" == ${MAC_UNAME} ]]; then
DATE_FORMAT="%Y-%m-%dT%H:%M:%S"
else
DATE_FORMAT="%Y-%m-%d %H:%M:%S"
fi
if [ -z "$1" ]; then
NOW_DATE=$(date "+${DATE_FORMAT}")
echo Please provide a mock time in the format \"${NOW_DATE}\" or \"d\" to del... | Shell |
#!/bin/sh
adb shell cat /data/data/com.google.android.apps.iosched/shared_prefs/com.google.android.apps.iosched_preferences.xml | xmllint --format - | Shell |
#!/bin/sh
# Remember VERBOSE only works on debug builds of the app
adb shell setprop log.tag.iosched_SyncHelper VERBOSE
adb shell setprop log.tag.iosched_SessionsHandler VERBOSE
adb shell setprop log.tag.iosched_ImageCache VERBOSE
adb shell setprop log.tag.iosched_ImageWorker VERBOSE
adb shell setprop log.tag.iosched_I... | Shell |
#!/bin/sh
adb shell pm clear com.google.android.apps.iosched | Shell |
#!/bin/sh
if [[ -z $ADB ]]; then ADB=adb; fi
$ADB shell am start \
-a android.intent.action.MAIN \
-c android.intent.category.LAUNCHER \
-n com.google.android.apps.iosched/.ui.HomeActivity
| Shell |
#!/bin/bash
################################################################################
#
# Bake is a shell script for running CakePHP bake script
# PHP versions 4 and 5
#
# CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
# Copyright 2005-2007, Cake Software Foundation, Inc.
# 1785 E. ... | Shell |
#!/bin/bash
################################################################################
#
# Bake is a shell script for running CakePHP bake script
# PHP versions 4 and 5
#
# CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
# Copyright 2005-2007, Cake Software Foundation, Inc.
# 1785 E. ... | Shell |
#!/bin/bash
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | Shell |
#!/bin/bash
#
# Copyright 2011 Google Inc. All Rights Reserved.
# Author: jcgregorio@google.com (Joe Gregorio)
#
# Uploads a training data set to Google Storage to be used by this sample
# application.
#
# Usage:
# setup.sh file_name bucket/object
#
# Requirements:
# gsutil - a client application for interacting with... | Shell |
#!/bin/bash
openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 \
-keyout privatekey.pem -out publickey.pem \
-subj "/CN=unit-tests"
openssl pkcs12 -export -out privatekey.p12 \
-inkey privatekey.pem -in publickey.pem \
-name "key" -passout pass:notasecret
| Shell |
export PYTHONPATH=`pwd`:${PYTHONPATH}
| Shell |
# for a xoperator.properties at a different location,
# simply add the path to the file as a single parameter,
# e.g.: java -jar agent.jar ../stuff/xoperator.properties
java -jar agent.jar 2>&1 >./logs/output-`date +"%Y%m%d-%H%M%S"`.log
| Shell |
# for a xoperator.properties at a different location,
# simply add the path to the file as a single parameter,
# e.g.: java -jar agent.jar ../stuff/xoperator.properties
java -jar agent.jar 2>&1 >./logs/output-`date +"%Y%m%d-%H%M%S"`.log
| Shell |
#!/bin/sh
APPDIR=`dirname $0`;
java -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:/home/joerg/.Trash/gwt-linux-1.5.0/gwt-user.jar:/home/joerg/.Trash/gwt-linux-1.5.0/gwt-dev-linux.jar" com.google.gwt.dev.GWTCompiler -out "$APPDIR/www" "$@" org.aksw.xoperator.xoperatorwebconfig.XoperatorWebConfig;
| Shell |
#!/bin/sh
APPDIR=`dirname $0`;
java -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:/home/joerg/.Trash/gwt-linux-1.5.0/gwt-user.jar:/home/joerg/.Trash/gwt-linux-1.5.0/gwt-dev-linux.jar" com.google.gwt.dev.GWTShell -out "$APPDIR/www" "$@" org.aksw.xoperator.xoperatorwebconfig.XoperatorWebConfig/XoperatorWebConfig.html;
| Shell |
#!/bin/sh
APPDIR=`dirname $0`;
java -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:/home/joerg/.Trash/gwt-linux-1.5.0/gwt-user.jar:/home/joerg/.Trash/gwt-linux-1.5.0/gwt-dev-linux.jar" com.google.gwt.dev.GWTShell -out "$APPDIR/www" "$@" org.aksw.xoperator.xoperatorwebconfig.XoperatorWebConfig/XoperatorWebConfig.html;
| Shell |
#!/bin/sh
APPDIR=`dirname $0`;
java -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:/home/joerg/.Trash/gwt-linux-1.5.0/gwt-user.jar:/home/joerg/.Trash/gwt-linux-1.5.0/gwt-dev-linux.jar" com.google.gwt.dev.GWTCompiler -out "$APPDIR/www" "$@" org.aksw.xoperator.xoperatorwebconfig.XoperatorWebConfig;
| Shell |
#!/bin/bash
java -jar ${project.build.finalName}.jar
| Shell |
#!/bin/bash
java -jar ${project.build.finalName}.jar
| Shell |
#!/bin/bash
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | Shell |
export PYTHONPATH=`pwd`:${PYTHONPATH}
| Shell |
#!/bin/bash
openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 \
-keyout privatekey.pem -out publickey.pem \
-subj "/CN=unit-tests"
openssl pkcs12 -export -out privatekey.p12 \
-inkey privatekey.pem -in publickey.pem \
-name "key" -passout pass:notasecret
| Shell |
#!/bin/bash
#
# Copyright 2011 Google Inc. All Rights Reserved.
# Author: jcgregorio@google.com (Joe Gregorio)
#
# Uploads a training data set to Google Storage to be used by this sample
# application.
#
# Usage:
# setup.sh file_name bucket/object
#
# Requirements:
# gsutil - a client application for interacting with... | Shell |
#!/bin/bash
if [ $# != 1 ]
then
echo "Usage: $0 emailAddress"
exit 1
fi
read -s -p "Password: " mypassword
echo ""
curl https://www.google.com/accounts/ClientLogin -d Email=$1 -d "Passwd=$mypassword" -d accountType=GOOGLE -d source=Google-cURL-Example -d service=ac2dm
| Shell |
#!/bin/sh
# Create a backup tar gzip file of the cwd with the date appended
# located in the parent directory.
FILENAME=../`pwd|xargs basename`-`date -j "+%Y-%m-%d"`.tgz
echo Will create $FILENAME
tar cfz $FILENAME .
echo Done.
| Shell |
#!/bin/bash
# Uses wget to fetch the given url and writes a file in the format expected by
# parse_tool.
url="$1"
file="$2"
body=`wget --save-headers -O - $url`
echo "${url}" > $file
echo "${body}" >> $file
| Shell |
#!/bin/bash
# Runs all parsers on each http file and writes the resulting out file. Reads
# from and writes to the current directory. Use with caution.
for f in `ls ./*.http`; do
g=`echo $f | sed 's/http/out/'`;
./parse_tool \
--parser_defs_glob=./*.xpd \
--input_file_path=$f 1>$g 2>/dev/null;
echo ... | Shell |
#!/bin/sh
set -ex
rm -rf autom4te.cache
mkdir -p m4
# Use glibtoolize if available (e.g. on Mac), libtoolize otherwise.
if which glibtoolize; then
LIBTOOLIZE=glibtoolize
else
LIBTOOLIZE=libtoolize
fi
aclocal --force -I m4
grep -q '^[^#]*AC_PROG_LIBTOOL' configure.ac && $LIBTOOLIZE -c -f
autoconf -f -W all,no-ob... | Shell |
#!/bin/sh
APPBUNDLE=Tremulous.app
BINARY=Tremulous.ub
DEDBIN=Tremded.ub
PKGINFO=APPLTREM
ICNS=misc/Tremulous.icns
DESTDIR=build/release-darwin-ub
BASEDIR=base
BIN_OBJ="
build/release-darwin-ppc/tremulous.ppc
build/release-darwin-x86/tremulous.x86
"
BIN_DEDOBJ="
build/release-darwin-ppc/tremded.ppc
build/release-da... | Shell |
#!/bin/sh
export CC=i586-mingw32msvc-gcc
export WINDRES=i586-mingw32msvc-windres
export PLATFORM=mingw32
exec make $*
| Shell |
#!/bin/bash
#
# This script appends the text from Q3A_EULA.txt to a .dmg as a SLA resource
#
# usage is './SLA-dmg.sh /path/to/Q3A_EULA.txt /path/to/ioquake3.dmg'
#
if [ "x$1" = "x" ] || [ "x$2" = "x" ]; then
echo "usage: ./SLA-dmg.sh /path/to/Q3A_EULA.txt /path/to/ioquake3.dmg"
exit 1;
fi
if [ ! -r $1 ]; then
ech... | Shell |
#!/bin/bash
#
# This script appends the text from Q3A_EULA.txt to a .dmg as a SLA resource
#
# usage is './SLA-dmg.sh /path/to/Q3A_EULA.txt /path/to/ioquake3.dmg'
#
if [ "x$1" = "x" ] || [ "x$2" = "x" ]; then
echo "usage: ./SLA-dmg.sh /path/to/Q3A_EULA.txt /path/to/ioquake3.dmg"
exit 1;
fi
if [ ! -r $1 ]; then
ech... | Shell |
#! /bin/sh
cd /tmp
# Make sure previous copies are gone
rm -rf quake3/
# Checkout a new copy of ioq3
svn co svn://svn.icculus.org/quake3/trunk/ quake3
cd quake3/
IOQ3REVISION=`svnversion .`
IOQ3VERSION=ioq3-r$IOQ3REVISION
rm -rf $IOQ3VERSION
svn export . $IOQ3VERSION
cd $IOQ3VERSION
# Remove READMEs and the like
... | Shell |
#! /bin/sh
cd /tmp
# Make sure previous copies are gone
rm -rf quake3/
# Checkout a new copy of ioq3
svn co svn://svn.icculus.org/quake3/trunk/ quake3
cd quake3/
IOQ3REVISION=`svnversion .`
IOQ3VERSION=ioq3-r$IOQ3REVISION
rm -rf $IOQ3VERSION
svn export . $IOQ3VERSION
cd $IOQ3VERSION
# Remove READMEs and the like
... | Shell |
#!/bin/sh
export CC=i586-mingw32msvc-gcc
export WINDRES=i586-mingw32msvc-windres
export PLATFORM=mingw32
exec make $*
| Shell |
#!/bin/sh
APPBUNDLE=Tremulous.app
BINARY=Tremulous.ub
DEDBIN=Tremded.ub
PKGINFO=APPLTREM
ICNS=misc/Tremulous.icns
DESTDIR=build/release-darwin-ub
BASEDIR=base
BIN_OBJ="
build/release-darwin-ppc/tremulous.ppc
build/release-darwin-x86/tremulous.x86
"
BIN_DEDOBJ="
build/release-darwin-ppc/tremded.ppc
build/release-da... | Shell |
#!/sbin/sh
# #!/system/bin/sh
echo "<b>Listing Root Directory:</b>"
ls /
echo " "
echo "<b>Running ls -l /</b>"
ls -l /
echo " "
echo "<b>Mounting /sdcard</b>"
mount -t auto /sdcard
echo " "
echo "<b>Listing /sdcard</b>"
ls /sdcard
echo " "
echo "<b>Mounting /system</b>"
mount -t auto /system
echo " "
echo "<b>Li... | Shell |
#!/sbin/sh
# #!/system/bin/sh
echo "<b>Evironment Variable Demo</b>"
echo "UPDATE_PACKAGE: <b>$UPDATE_PACKAGE</b>"
echo "AROMA_TMP: <b>$AROMA_TMP</b>"
echo "AROMA_NAME: <b>$AROMA_NAME</b>"
echo "AROMA_COPY: <b>$AROMA_COPY</b>"
echo "AROMA_VERSION: <b>$AROMA_VERSION</b>"
echo "AROMA_BUILD: <b>$AROMA_BUILD</b>"
echo "AR... | Shell |
#!/sbin/sh
# #!/system/bin/sh
echo "<b>Evironment Variable Demo</b>"
echo "UPDATE_PACKAGE: <b>$UPDATE_PACKAGE</b>"
echo "AROMA_TMP: <b>$AROMA_TMP</b>"
echo "AROMA_NAME: <b>$AROMA_NAME</b>"
echo "AROMA_COPY: <b>$AROMA_COPY</b>"
echo "AROMA_VERSION: <b>$AROMA_VERSION</b>"
echo "AROMA_BUILD: <b>$AROMA_BUILD</b>"
echo "AR... | Shell |
#!/sbin/sh
# #!/system/bin/sh
echo "<b>Listing Root Directory:</b>"
ls /
echo " "
echo "<b>Running ls -l /</b>"
ls -l /
echo " "
echo "<b>Mounting /sdcard</b>"
mount -t auto /sdcard
echo " "
echo "<b>Listing /sdcard</b>"
ls /sdcard
echo " "
echo "<b>Mounting /system</b>"
mount -t auto /system
echo " "
echo "<b>Li... | Shell |
#! /bin/bash
i=1
sum=0
while [ $i -le 100 ]
do
let sum+=i
let i+=1
done
echo $sum
| Shell |
#! /bin/bash
if [ $# -lt 1 ]
then
echo "No parameters specified."
exit 1
fi
max=$1
min=$1
for p in $*
do
if [ $p -gt $max ]
then
max=$p
fi
if [ $p -lt $min ]
then
min=$p
fi
done
echo "max=$max"
echo "min=$min"
| Shell |
#! /bin/bash
i1=1; echo -e "$i1\t\c"
i2=1; echo -e "$i2\t\c"
j=2
while [ $j -lt 20 ]
do
let i=i1+i2
let i1=i2
let i2=i
echo -e "$i\t\c"
let j=j+1
let t=j5% # test can not use a complex expr
if [ $t -eq 0 ]; then
echo
fi
done
| Shell |
#! /bin/bash
i=1
sum=0
while [ $i -le 100 ]
do
let sum+=i
let i+=1
done
echo $sum
| Shell |
#! /bin/bash
if [ $# -lt 1 ]
then
echo "No parameters specified."
exit 1
fi
max=$1
min=$1
for p in $*
do
if [ $p -gt $max ]
then
max=$p
fi
if [ $p -lt $min ]
then
min=$p
fi
done
echo "max=$max"
echo "min=$min"
| Shell |
#! /bin/bash
i1=1; echo -e "$i1\t\c"
i2=1; echo -e "$i2\t\c"
j=2
while [ $j -lt 20 ]
do
let i=i1+i2
let i1=i2
let i2=i
echo -e "$i\t\c"
let j=j+1
let t=j5% # test can not use a complex expr
if [ $t -eq 0 ]; then
echo
fi
done
| Shell |
#!/bin/sh
# Ask some questions and collect the answer
gdialog --title "Questionnaire" --msgbox "Welcome to my simple survey" 9 18
gdialog --title "Confirm" --yesno "Are you willing to take part?" 9 18
if [ $? != 0 ]; then
gdialog --infobox "Thank you anyway" 5 20
sleep 2
gdialog --clear
exit 0
fi... | Shell |
#!/bin/sh
foo="The first meta-syntactic variable"
export bar="The second meta-syntactic variable"
./export2
| Shell |
#!/bin/sh
foo=1
while [ "$foo" -le 20 ]
do
echo "Here we go again"
foo=$(($foo+1))
done
exit 0 | Shell |
#!/bin/bash
until who | grep "$1" > /dev/null
do
sleep 60
done
# Now ring the bell and announce the unexpected user.
echo -e '\a'
echo "***** $1 has just logged in *****"
exit 0
| Shell |
#!/bin/sh
sample_text="global variable"
foo() {
local sample_text="local variable"
echo "Function foo is executing"
echo $sample_text
}
echo "script starting"
echo $sample_text
foo
echo "script ended"
echo $sample_text
exit 0
| Shell |
#!/bin/sh
for foo in bar fud 43
do
echo $foo
done
exit 0
| Shell |
#!/bin/sh
echo "Is it morning? Please answer yes or no"
read timeofday
case "$timeofday" in
yes | y | Yes | YES ) echo "Good Morning";;
n* | N* ) echo "Good Afternoon";;
* ) echo "Sorry, answer not recognised";;
esac
exit 0
| Shell |
#!/bin/sh
unset foo
echo ${foo:-bar}
foo=fud
echo ${foo:-bar}
foo=/usr/bin/X11/startx
echo ${foo#*/}
echo ${foo##*/}
bar=/usr/local/etc/local/networks
echo ${bar%local*}
echo ${bar%%local*}
exit 0
| Shell |
#!/bin/sh
version=classic
PATH=/usr/local/old_bin:/usr/bin:/bin:.
PS1="classic> "
| Shell |
#!/bin/bash
# Very simple example shell script for managing a CD collection.
# Copyright (C) 1996-2007 Wiley Publishing Inc.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of... | Shell |
#!/bin/bash
# Very simple example shell script for managing a CD collection.
# Copyright (C) 1996-2007 Wiley Publishing Inc.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of... | Shell |
#!/bin/sh
rm -f fred
if [ -f fred ]; then
:
else
echo file fred does not exist
fi
exit 0
| Shell |
#!/bin/sh
ed textfile <<!FunkyStuff!
3
d
.,\$s/is/was/
w
q
!FunkyStuff!
exit 0
| Shell |
#!/bin/sh
# Ask some questions and collect the answer
dialog --title "Questionnaire" --msgbox "Welcome to my simple survey" 9 18
dialog --title "Confirm" --yesno "Are you willing to take part?" 9 18
if [ $? != 0 ]; then
dialog --infobox "Thank you anyway" 5 20
sleep 2
dialog --clear
exit 0
fi
di... | Shell |
#!/bin/sh
# first
# This file looks through all the files in the current
# directory for the string POSIX, and then prints the name of
# those files to the standard output.
for file in *
do
if grep -q POSIX $file
then
echo $file
fi
done
exit 0
| Shell |
#!/bin/sh
echo "Is it morning? Please answer yes or no"
read timeofday
if [ $timeofday = "yes" ]
then
echo "Good morning"
elif [ $timeofday = "no" ]; then
echo "Good afternoon"
else
echo "Sorry, $timeofday not recognized. Enter yes or no"
exit 1
fi
exit 0
| Shell |
#!/bin/sh
myvar="Hi there"
echo $myvar
echo "$myvar"
echo '$myvar'
echo \$myvar
echo Enter some text
read myvar
echo '$myvar' now equals $myvar
exit 0
| Shell |
#!/bin/sh
echo "$foo"
echo "$bar"
| Shell |
#!/bin/sh
echo "Is it morning? Please answer yes or no"
read timeofday
case "$timeofday" in
"yes") echo "Good Morning";;
"no" ) echo "Good Afternoon";;
"y" ) echo "Good Morning";;
"n" ) echo "Good Afternoon";;
* ) echo "Sorry, answer not recognised";;
esac
exit 0
| Shell |
#!/bin/sh
echo "Enter password"
read trythis
while [ "$trythis" != "secret" ]; do
echo "Sorry, try again"
read trythis
done
exit 0
| Shell |
#!/bin/sh
echo The date is $(date)
set $(date)
echo The month is $2
exit 0
| Shell |
#!/bin/sh
echo "$foo"
echo "$bar"
| Shell |
#!/bin/sh
echo "Is it morning? Please answer yes or no"
read timeofday
case "$timeofday" in
yes | y | Yes | YES ) echo "Good Morning";;
n* | N* ) echo "Good Afternoon";;
* ) echo "Sorry, answer not recognised";;
esac
exit 0
| Shell |
#!/bin/sh
rm -f file_one
if [ -f file_one ] || echo "hello" || echo "there"
then
echo "in if"
else
echo "in else"
fi
exit 0
| Shell |
#!/bin/sh
myvar="Hi there"
echo $myvar
echo "$myvar"
echo '$myvar'
echo \$myvar
echo Enter some text
read myvar
echo '$myvar' now equals $myvar
exit 0
| Shell |
#!/bin/sh
if [ -f /bin/bash ]
then
echo "file /bin/bash exists"
fi
if [ -d /bin/bash ]
then
echo "/bin/bash is a directory"
else
echo "/bin/bash is NOT a directory"
fi
| Shell |
#!/bin/sh
echo "Is it morning? Please answer yes or no"
read timeofday
if [ $timeofday = "yes" ]; then
echo "Good morning"
else
echo "Good afternoon"
fi
exit 0
| Shell |
#!/bin/sh
echo "Is it morning? Please answer yes or no"
read timeofday
case "$timeofday" in
yes | y | Yes | YES )
echo "Good Morning"
echo "Up bright and early this morning?"
;;
[nN]* )
echo "Good Afternoon"
;;
* )
echo "Sorry, an... | Shell |
#!/bin/sh
echo "Is it morning? Please answer yes or no"
read timeofday
if [ $timeofday = "yes" ]
then
echo "Good morning"
elif [ $timeofday = "no" ]; then
echo "Good afternoon"
else
echo "Sorry, $timeofday not recognized. Enter yes or no"
exit 1
fi
exit 0
| Shell |
#!/bin/sh
unset foo
echo ${foo:-bar}
foo=fud
echo ${foo:-bar}
foo=/usr/bin/X11/startx
echo ${foo#*/}
echo ${foo##*/}
bar=/usr/local/etc/local/networks
echo ${bar%local*}
echo ${bar%%local*}
exit 0
| Shell |
#!/bin/sh
yes_or_no() {
echo "Is your name $* ?"
while true
do
echo -n "Enter yes or no: "
read x
case "$x" in
y | yes ) return 0;;
n | no ) return 1;;
* ) echo "Answer yes or no"
esac
done
}
echo "Original parameters are $*"
if yes_or_no "$1"
then
echo "Hi $1, nice... | Shell |
#!/bin/sh
foo="The first meta-syntactic variable"
export bar="The second meta-syntactic variable"
./export2
| Shell |
#!/bin/bash
until who | grep "$1" > /dev/null
do
sleep 60
done
# Now ring the bell and announce the unexpected user.
echo -e '\a'
echo "***** $1 has just logged in *****"
exit 0
| Shell |
#!/bin/sh
version=classic
PATH=/usr/local/old_bin:/usr/bin:/bin:.
PS1="classic> "
| Shell |
#!/bin/sh
foo=1
while [ "$foo" -le 20 ]
do
echo "Here we go again"
foo=$(($foo+1))
done
exit 0 | Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.