Hi there,
I'm trying to write a simple bash script but something seems wrong, I'm testing the following on the command line:
DATE="2010-09-{10,11}"
result=`\ls *ext.$DATE.Z`
and results in ls: cannot access *ext.2010-09-{10,11}.Z: No such file or directory
but if I execute this:
result=`\ls *ext.2010-09-{10,11}.Z`
it works flawle...
Need some shell scripting help, especially with my if-then-else logic. I want to combine both conditions, but not sure if the file checks will work the same? Should I be doing something like a nested if?? My script uses the if statements to do file checks to see if they exist, then do something..
There is probably a better way to do fi...
I'm trying to find a way to get date and time separately. For date I can do:
date -u +%d/%m/%Y
What should I do to find the time in the following format?
hh/mm/ss
Thanks
...
I've got a problem with my shell script. I am basically trying to create a new log file from (2) files using unix (zcat, cat) commands
FileA = gzipped logfile (.gz)
FileB = non-gzipped log file (.log)
FileC = new file from FileA:FileB
My problem is with FileC.
For example:
FileA has timestamp data from Aug19-Sept3
FileB has timest...
Hello,
I have following string
â â³ eGalax Inc. USB TouchController id=9 [slave pointer (2)]
â â³ eGalax Inc. USB TouchController id=10 [slave pointer (2)]
and would like to get the list of id ? How this can be done using sed or something else ?
Regards,
Levon
...
In Linux how can I fetch an URL and get its contents in a variable in shell script?
...
I have the following code inside a Makefile:
# Root Path
echo "What is the root directory of your webserver? Eg. ~/Server/htdocs" ;
read root_path ;
echo $root_path ;
if [ ! -d $root_path ] ; then \
echo "Error: Could not find that location!" ; exit 1 ; \
fi
However when typing anything (eg. "asd") this is what gets returned:
Wha...
I have already made a regex which should work, but it doesn't work.
echo "FileName.17:09:2010 4.16.PM.720p.mp4" | sed -E 's/\d{2}:\d{2}:\d{4}\ (\d|\d{2})\.(\d{2}|\d)\.((AM)|(PM))//g'
Should output: FileName..720p.mp4
But instead outputs the same "FileName.17:09:2010 4.16.PM.720p.mp4".
...
Hi All,
i want to move logs files from one path(source path) to another path(destination path). This source path and destination path is present in one text file. as::
source_path=abc/xyz
source_path=pqr/abc
desination_path=abcd/mlk
so i read this file and stored paths in different variables.i have multiple source path so i s...
I am trying to trigger the running of a shell script using PHP. Essentially, when a user completes an action on our website programmed in PHP, we want to trigger a shell script which itself calls a Java file. Thanks in advance!
...
I am trying to use Bourne shell scripting for the first time ever, and I cannot seem to figure out determining how to save text from a file to internal script variables. The file format is as follows:
acc.text
Jason Bourne 213.4
Alice Deweger 1
Mark Harrington 312
The current script that I have (which might be ENTIRELY incorrect as I...
#!/bin/ksh
file_name=/home/file2.sh
used_var=`grep "poet" $file_name`
I want to check if file2.sh exists and also if used_var has some value or it has nothing.
...
#!/bin/sh
tar=$1
if [ -f $tar ]
then
tar xvf $tar
else
exit 1
fi
... <more code>
I need a conformation that the tar actually happened successfully, otherwise abort the execution of the script.
The tar file extract might not go through because
some problems with tar command
access issues with $tar
Do Linux utilities have s...
Consider the following:
$ cat t.sh
echo "This is from t.sh"
eval "t2.sh"
echo "\$FROM_t2=$FROM_t2"
$ cat t2.sh
echo "This is from t2.sh"
export FROM_t2="env_var_from_t2"
I want to read the value of "FROM_t2" created by t2.sh into t.sh. Is this possible?
...
The end of git status looks like this:
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# Classes/Default.png
# Classes/[email protected]
...
Since you might have any number of untracked files, I'm trying to tail from the end of the file to "Untracked files" and save it to a temp file, s...
Hi guys,
I'm a UNIX shell script programmer, and I would like to know if there is any certification specific for Shell (bash, korn,etc) programmers. Could you help please?
Also how about CX-310-105 exam to take Oracle Solaris Associate, does it have value on the market?
Thanks
...
Hi,
I'm looking for a command which finds all files in a directory using a specific partern, lets say "*.txt" and create a list of parameters from it in BASH.
So if the dir contains:
file1.txt
file2.txt
file3.txt
nonsense.c
I need the string "file1.txt file2.txt file3.txt"
I knew there was a BASH/Unix command for this, but I can't re...
Hi,
I have a date value stored in a unix korn shell variable
VALUE="2010_09_23"
I want to change it to "23-Sep-2010" and store it in VALUE1. How can i do it?
VALUE1="23-Sep-2010"
...
Hello
I want to save the value in a variable in this script:
#!/bin/sh
filename=$1
var= $filename | sed 's/\([A-Z]\)/ \1/g';
return var;
(Firstable, I am not sure if it is correct), and after thar, get this value and use it in my Java program, like this:
Process s = Runtime.getRuntime().exec("./CreateTitle.sh "+filename);
OutputStr...
I am trying to write a shell script to check database connectivity. Within my script I am using the command
sqlplus uid/pwd@database-schemaname
to connect to my Oracle database.
Now I want to save the output generated by this command (before it drops to SQL prompt) in a temp file and then grep / find the string "Connected to" from t...