Sponsored Content
The Lounge What is on Your Mind? Just did something so stupid... Post 302957416 by Riker1204 on Saturday 10th of October 2015 01:17:05 PM
Old 10-10-2015
Just did something so stupid...

Firstly I'm learning shell scripting and I came across this example in Classic Shell Scripting

dirpath=`eval echo '${'"$envvar"'}' 2>/dev/null | tr : ' ' `

And I immediately became perplexed as to how $envvar gets expanded in between the surrounding single quotes, until 20 minutes later i realized that there are two SETS of single quotes on both sides of the double quotes.

I keep making these type of silly errors. I absolutely love learning automation, but damn that made me feel stupid. 20 minutes.....
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Really New and probably stupid...

I am interested in installing a Unix operating system onto my PC. I was wondering which system would be the best for a total newbie and also how much knowledge of programming languages do I need to get decent results with a Unix system? I really am starting from scratch so please help all that you... (1 Reply)
Discussion started by: Dr_KillBlair
1 Replies

2. UNIX for Dummies Questions & Answers

Stupid Question?

I have a SparcStation 10 and it came with an external CD Rom Drive. I am trying to install Solaris 2.6 Server on this machine from the Cd Rom. At the OK> prompt I type "boot cdrom - browser" and I get an error: scsi device not found:error = -1 or something to that effect. Does anyone have any... (9 Replies)
Discussion started by: jskillet
9 Replies

3. UNIX for Dummies Questions & Answers

I am stupid

I am trying to tar file to a local tape drive using tar cf /dev/rmt/0cn ./directory The process appears to run and I can see activity on the tape drive, but, then I use tar t /dev/rmt/0cn but I do not see anything there. I am running Solaris 8 on a 420R. (5 Replies)
Discussion started by: CoreyH
5 Replies

4. UNIX for Dummies Questions & Answers

Stupid question...

Hello, I've always been around systems that ran windows in one version or another, so I'm familiar with what/when/where/drivers/etc for that. I want to build a unix box to use as a place to learn and become more familiar with unix. I would also like to eventually convert it to a server to... (6 Replies)
Discussion started by: Cortney
6 Replies

5. UNIX for Dummies Questions & Answers

Really Stupid

I Know this is a really stupid question but if you can please expalin me. I know how to compile a file in unix whith c++ but i dont know how to execute it. I was expectin something like in windows that there will be created a *.rpm file or somethin like that (like *.exe in windows) .... ... (2 Replies)
Discussion started by: user666
2 Replies

6. UNIX for Dummies Questions & Answers

stupid question!?

fedora core 2 xx8. 5xx version (not sure! not sure how to look it up either..(except on boot sorry!!)).. :( the linux version I started on last year was an old redhet 6.0 version with only text mode.. back then for some reason I knew I how to get rid of whole directories without a) going through... (6 Replies)
Discussion started by: moxxx68
6 Replies

7. UNIX for Dummies Questions & Answers

One stupid question

Has anybody come across the situation when after openning the cover of HP9000 the PC will not start. We checked everything but did not manage to find any solution to that. The PS seems to be functionning (at lease we can hear it clicking). Please help us solving the problem. Thanks to everybody. (2 Replies)
Discussion started by: Andrey Malishev
2 Replies

8. UNIX for Dummies Questions & Answers

Stupid question

Hi all, Please excuse my ignorance - I'm a Cisco kid and my knowledge of Unix is somewhat flaky!! Basically we're running MRTG on an HP-UX server and wondered what the "-" means in the following text within the crontab file - -* * * * * root /home/mrtg/fwdev01.sh I... (3 Replies)
Discussion started by: freakydancer
3 Replies

9. UNIX for Dummies Questions & Answers

Stupid question

I just began learning how to use Unix, so forgive my stupidity. I know this is answered somewhere but it's pretty specific and probably easily answered. When I use some commands (particularly recently, the grep command) my terminal seems to freeze up. It switches out of bash mode and into the... (2 Replies)
Discussion started by: ems5311
2 Replies
escape(1)							Mail Avenger 0.8.3							 escape(1)

NAME
escape - escape shell special characters in a string SYNOPSIS
escape string DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result. EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string: $ var='; echo gotcha!' $ eval echo hi $var hi gotcha! $ Using escape, one can avoid executing the contents of $var: $ eval echo hi `escape "$var"` hi ; echo gotcha! $ A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient: #!/bin/sh formail -x to -x cc -x resent-to -x resent-cc | fgrep "$1" > /dev/null && exit 0 echo "<$1>.. address does not accept blind carbon copies" exit 100 To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt script: bodytest reject_bcc `escape "$RECIPIENT"` SEE ALSO
avenger(1), The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 escape(1)
All times are GMT -4. The time now is 11:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy