Repository navigation
Expand file tree
/
Copy pathUNIXShellBase.java
More file actions
70 lines (61 loc) · 1.71 KB
/
Copy pathUNIXShellBase.java
File metadata and controls
70 lines (61 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package shellScriptGen.shells;
/**
* This class provides a base for all UNIX shell script types. Since
* there are so many flavors of shell scripts (C Shell, BASH etc), I wanted any future UNIX shell
* scripts to derive from this one to make things easy. For all UNIX scripts, things such as the
* classpath separator, comment character etc are the same so this allows the sub-classes to implement
* only those methods that are specific to that particular shell script type.
*
* @author Amit Nithian ([email protected])
*
*/
public abstract class UNIXShellBase implements ShellScriptInterface
{
public String getFileSeparator()
{
return "/";
}
public String getCPSeparator()
{
// TODO Auto-generated method stub
return ":";
}
public String getComment()
{
// TODO Auto-generated method stub
return "#";
}
public String getExecuteScriptLine(String pScriptToExec)
{
// TODO Auto-generated method stub
return "source " + pScriptToExec;
}
public String getVariableReference(String pVariableName)
{
// TODO Auto-generated method stub
return "${" + pVariableName + "}";
}
/**
* Helper method to create a blank shell script given a file handle.
*
* @param pFile The file handle of the script to be created.
*
protected final void createBlankScript(File pFile)
{
try
{
PrintWriter pWriter = new PrintWriter(new FileWriter(pFile));
pWriter.println(m_sShellLine);
pWriter.println("#Put any pre-config script here");
pWriter.flush();
pWriter.close();
addFileToFinishMessage(pFile);
}
catch(IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
*/
}