If I don't explain my issue well enough, I apologize ahead of time, extreme newbie here to scripting.
I'm currently learning scripting from books and have moved on to the text Wicked Cool Shell Scripts by Dave Taylor, but there are still basic concepts that I'm having trouble understanding.
The code I was working with is meant to verify whether a particular program is valid or can be found in the path directory list. It's the latter process that I don't understand will explain further. The code I was working with is as follows (p. 11 of Wicked Cool Shell Scripts)
Now when I enter 'inpath echo' at the command line (as per the instructions) I get this error message
-bash: inpath: command not found
I'm pretty certain I entered the code correctly, so I'm assuming the problem has to do with my not understanding the concept of paths, and so far no text has explained it in a way that I've understood so far.
Could someone please help me understand this because I'm currently stuck.
I did both those things and, to be honest, I'm not sure how to copy and paste the code. Like I said, major newbie (not about copy and paste, but doing so when using the terminal window of Mac OSX 10.7).
I tried accessing the file outside of the terminal, but it's listed as an executable and I'm not sure what would happen if I opened it that way.
I have this code
#!/bin/bash
LZ () {
RETVAL="\n$(date +%Y-%m-%d_%H-%M-%S) --- "
return RETVAL
}
echo -e $LZ"Test"
sleep 3
echo -e $LZ"Test"
which I want to use to make logentrys on my NAS. I expect of this code that there would be output like
2017-03-07_11-00-00 --- Test (4 Replies)
Hi
i was going through the script debugging technique. below example was given in the book.
1 #!/bin/sh
2
3 Failed() {
4 if ; then
5 echo "Failed. Exiting." ; exit 1 ;
6 fi
7 echo "Done."
8 }
9
10 echo "Deleting old backups,... (11 Replies)
Hi all,
I'm not clear of this regexp command:
regexp {(\S+)\/+$} $String match GetString
From my observation and testing,
if $String is abc/def/gh
$GetString will be abc/def
I don't understand how the /gh in $String got eliminated.
Please help. Thanks (2 Replies)
i am beginner in shell scripting.
not able to understand what below line will do.
PS1=${HOST:=´uname -n´}"$ " ; export PS1 HOST
below is the script
#!/bin/hash
PS1=${HOST:=´uname -n´}"$ " ; export PS1 HOST ;
echo $PS1
and i getting the below output
´uname -n´$ (25 Replies)
Its very critical and 'm in need to schedule this on my crontab so that the output can be monitored by a tool
I have written the command below to redirect the error which has the output redirected to the file gincle_lol.log.
echo "---" >>/gingle/gincle_lol.log
date... (1 Reply)
Its very critical and 'm in need to schedule this on my crontab so that the output can be monitored by a tool
I have written the command below to redirect the error which has the output redirected to the file gincle_lol.log.
Code:
echo "---" >>/gingle/gincle_lol.log
date... (0 Replies)
Hi,
Can anyone please let me know the meaning of this line,i am not able to understand the egrep part(egrep '^{1,2}).This will search for this combination in beginning but what does the values in {}signifies here.
/bin/echo $WhenToRun | egrep '^{1,2}:$' >/dev/null (1 Reply)
Hi there!
People, i'm a new unix user, and i'm having some problems...
I'm updating some scripts (korn shell) in different servers. I use telnet to access these servers and emacs to write the scripts. One of them is an HP, and there´s no problem. But the other one is an AIX, and when i call... (1 Reply)