01-02-2011
What are all those "$$" for? Did you mean that to be && or ||
It produces the comic list when I replace them with &&.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi!,
How can I check the number of arguments passed from the shell in a bash shell ? (1 Reply)
Discussion started by: DNAx86
1 Replies
2. Shell Programming and Scripting
Hello,
I have a very stupid/simple problem, but for some reason I cannot figure out...and I need your help!
I am writting a bash scrip that should be executed using "my_script X Y Z T" where X Y Z and T can be any string, but there can be any number of arguments.
I want my script to do... (4 Replies)
Discussion started by: jolecanard
4 Replies
3. Shell Programming and Scripting
This script is called fuu;
#!/bin/bash
speak() {
case $1 in
1)echo one
;;
2)echo two
;;
3)echo three
;;
esac
}
speak
exit 0
when i run fuu 2 i expect "two" like... (2 Replies)
Discussion started by: Tártaro
2 Replies
4. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
Write a shell program called myenv which takes one argument. The argument should be the name of an environment variable, such as PATH HOME etc. myenv should print out the value of the variable given as the argument. If no argument is... (1 Reply)
Discussion started by: Helix
1 Replies
5. Shell Programming and Scripting
this script moves all the doc files to a specified directory....i have managed to put an argument but the problem im facing is puting the full path where the scripts are moving to for example i want to run the script like this below
./loo -d then path where im moving the files (i.e ./loo -d the... (2 Replies)
Discussion started by: elginmulizwa
2 Replies
6. Shell Programming and Scripting
This script moves all the doc files to a specified directory. I have managed to put an argument but the problem I am facing is putting the full path where the scripts are moving to, for example I want to run the script like this below
./loo -d then path where im moving the files (i.e ./loo -d... (3 Replies)
Discussion started by: elginmulizwa
3 Replies
7. Shell Programming and Scripting
Could someone help me with the script below?
I am trying to make a script having just one arguement as a command and then it executes the appropriate code
#!/bin/bash
if
then
echo "Available commands:"
echo "./exec.sh cmd1"
echo "./exec.sh cmd2"
elif
then
cmd1 =... (1 Reply)
Discussion started by: spiridakos
1 Replies
8. Shell Programming and Scripting
Hi,
I wanted to pass an argument to a bash script. So that the argument is used inside the awk command inside the bash script.
I know the noraml way of passing argument to a bash script as below :
sh myScript.sh abc
Inside the bash script i can use like this
myArg1=$1
wc $myArg
But... (8 Replies)
Discussion started by: shree11
8 Replies
9. Shell Programming and Scripting
I'm reading Wicked Cool Shell Scripts. For some reason, the function pasted in below gives the error: ./inpath2: line 10: in_path()
4 {
5 cmd=$1 ourpath=$2 result=1
6 oldIFS=$IFS IFS=":"
7
8 for directory in "$ourpath"
9 do
10 if ; then
11 result=0
12 fi... (9 Replies)
Discussion started by: jakeroberts
9 Replies
10. Shell Programming and Scripting
Hello everyone,
Could someone please explain to me why I get cd: too many arguments when I select a dir that has one or more spaces in the name?
This is the code
#!/bin/bash
tmp_loc=$(zenity --file-selection --directory)
if ]; then
exit 0
else
location=${tmp_loc// /\\ } # this... (7 Replies)
Discussion started by: soichiro
7 Replies
LEARN ABOUT LINUX
git-replace
GIT-REPLACE(1) Git Manual GIT-REPLACE(1)
NAME
git-replace - Create, list, delete refs to replace objects
SYNOPSIS
git replace [-f] <object> <replacement>
git replace -d <object>...
git replace -l [<pattern>]
DESCRIPTION
Adds a replace reference in refs/replace/ namespace.
The name of the replace reference is the SHA-1 of the object that is replaced. The content of the replace reference is the SHA-1 of the
replacement object.
The replaced object and the replacement object must be of the same type. This restriction can be bypassed using -f.
Unless -f is given, the replace reference must not yet exist.
There is no other restriction on the replaced and replacement objects. Merge commits can be replaced by non-merge commits and vice versa.
Replacement references will be used by default by all Git commands except those doing reachability traversal (prune, pack transfer and
fsck).
It is possible to disable use of replacement references for any command using the --no-replace-objects option just after git.
For example if commit foo has been replaced by commit bar:
$ git --no-replace-objects cat-file commit foo
shows information about commit foo, while:
$ git cat-file commit foo
shows information about commit bar.
The GIT_NO_REPLACE_OBJECTS environment variable can be set to achieve the same effect as the --no-replace-objects option.
OPTIONS
-f, --force
If an existing replace ref for the same object exists, it will be overwritten (instead of failing).
-d, --delete
Delete existing replace refs for the given objects.
-l <pattern>, --list <pattern>
List replace refs for objects that match the given pattern (or all if no pattern is given). Typing "git replace" without arguments,
also lists all replace refs.
CREATING REPLACEMENT OBJECTS
git-filter-branch(1), git-hash-object(1) and git-rebase(1), among other git commands, can be used to create replacement objects from
existing objects.
If you want to replace many blobs, trees or commits that are part of a string of commits, you may just want to create a replacement string
of commits and then only replace the commit at the tip of the target string of commits with the commit at the tip of the replacement string
of commits.
BUGS
Comparing blobs or trees that have been replaced with those that replace them will not work properly. And using git reset --hard to go back
to a replaced commit will move the branch to the replacement commit instead of the replaced commit.
There may be other problems when using git rev-list related to pending objects.
SEE ALSO
git-hash-object(1) git-filter-branch(1) git-rebase(1) git-tag(1) git-branch(1) git(1)
GIT
Part of the git(1) suite
Git 1.8.5.3 01/14/2014 GIT-REPLACE(1)